Is it a good idea for a muslim to pray for wrong/evil doer,and a disbeliever?
Salaam Alaiykum. Muslims may certainly beseech Allah Subhana wa Ta’ala in their prayers for the benefit of non-Muslims. There can be no question that we should ask Allah to guide them to faith.
The Prophet (peace be upon him) said: “O Lord, support Islam by the most beloved
The Prophet (peace be upon him) said in another hadîth: “O Lord guide my people, they do not know (the true path)”
There is only one matter that we are not supposed to beseech on their behalf – that is for Allah Subhana wa Ta’ala to forgive them while they remain upon unbelief.
This prohibition is established by the following verse of the Qur’ān:
Allah says: “It is not fitting for the Prophet and those who believe, that they should pray for forgiveness for the polytheists, even though they be of kin, after it is clear to them that they are companions of the Fire.” [Sûrah al-Tawbah: 113]
This verse was revealed on a particular occasion. The Prophet’s beloved uncle, Abû Tâlib, was dying and he had not accepted Islam. The Prophet (peace be upon him) pleaded with his uncle to accept Islam on his deathbed. To the Prophet’s dismay, Abû Tâlib refused to do so. Nevertheless, the Prophet (peace be upon him) promised his uncle: “I will beseech Allah’s forgiveness for you as long as Allah does not forbid me to do so.” It was after this that the above verse was revealed. [Sahîh al-Bukhârî]
As for our supplications for non-Muslims regarding worldly matters – like prosperity, health, recovery from illness, and other concerns – this is a virtuous act for the Muslim. Indeed, it is most emphatically encouraged where the non-Muslim happens to be a close relative, and especially when that person is a parent.
It makes sense to say that as long as the non-Muslim is not at war with the Muslims or actively engaged in bringing harm to the Muslims, we may ask Allah Subhana wa Ta’ala for that person’s success and welfare in this world. Allah says: “With respect to those who neither fight you on account of your faith nor drive you from your homes, Allah does not prevent you from doing good for them and treating them equitably. Indeed, Allah loves those who behave equitably.” [Sûrah al-Mumtahanah: 8]
When a non-Muslim is ill or in need, our supplicating on his or her behalf is a way of doing good for that person. It is a noble act. It is a virtuous deed, just like lending that person a helping hand or fulfilling that person’s material needs are virtuous acts. As long as disbelievers are alive, we can pray to Allah Subhana wa Ta’ala to guide them and grant them the sense so that they realize the importance of believing. But if they die in the state of disbelief, meaning that they disbelieve in Allah or associate partners with Him, that person will never be forgiven by Allah and such a person will surely go to Hellfire. Therefore in accordance with the dictates of Allah, for such people who have passed away, we as believers are not allowed to pray nor ask Allah to forgive them.
Allah Almighty has made this point very clear in the Quran to the Prophet (pbuh) and to the believers.
"And never (O Muhammad) pray for one of them who dieth, nor stand by his grave. Lo! they disbelieved in Allah and His messenger, and they died while they were evil-doers." (9:84) Surah At-Taubah
"It is not for the Prophet, and those who believe, to pray for the forgiveness of idolaters even though they may be near of kin (to them) after it hath become clear that they are people of hell-fire.
The prayer of Abraham for the forgiveness of his father was only because of a promise he had promised him, but when it had become clear unto him that he (his father) was an enemy to Allah he (Abraham) disowned him. Lo! Abraham was soft of heart, long-suffering." (9:113-114) Surah At-Taubah