Praise be to Allah.
The waswas which people experience is not all of the same type or degree, either in terms of the type of sickness or in terms of its source and effect.
The kind of waswas which tempts a person to listen to or look at haram (unlawful) things or to commit immoral actions, and makes such things appear attractive to him, comes from three sources: the nafs (or self), which is inclined to evil, the devils among the jinn (demons), and the devils among mankind.
Allah says, describing the first source, which is the nafs (interpretation of the meaning):
Allah says, describing the second source, which is the devils among the jinn (interpretation of the meaning):
And Allah says, describing the third source, which is the devils among mankind (interpretation of the meaning):
So these waswas may come from the jinn or from the sons of Adam (human beings).
Please see question no. 59931
What happens to a Muslim regarding his wudu and prayer, where he does not know how many times he washed during wudu or how many rak’ahs (units of prayer) he did in prayer, comes from the Shaytan. If he seeks refuge with Allah from the Shaytan, Allah will suffice him against him. But if he gives in to him and responds to the waswas, the Shaytan will gain power over him, and that waswas will become a chronic problem. This is what is called al-waswas al-qahri (overwhelming waswas or OCD). This kind of waswas – as one of those who are specialized in this field said – “is a sickness which befalls some people like any other kind of sickness. It refers to repeated thoughts, movements, ideas or notions which are of a loathsome nature that a person would ordinarily reject and strive to resist. He also realizes that they are wrong and have no meaning, but there is something that is pushing him towards them and he usually fails to resist them. The strength of these waswas may vary, so much so that they appear – to non-specialists – to be very strong and it seems that the sick person is doing that willingly. This kind of waswas may also affect a person in his worship and in his worldly affairs.”
The waswas of the Shaytan may be dispelled by seeking refuge with Allah.
The waswas that comes from one’s own self may also be dispelled by seeking refuge with Allah, and by strengthening the connection between a person and his Lord by doing acts of worship and obedience and by giving up evil things.
As for al-waswas al-qahri (OCD), it is a kind of sickness as stated above.
The difference between the waswas that comes from the Shaytan and the waswaas that comes from the nafs is subtle, as was quoted by Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) from some of the scholars. He said:
Abu Haazim made a comparison between the waswasah caused by the nafs and that caused by the Shaytan, and said: Whatever your nafs hates for your nafs is from the Shaytan, so seek refuge with Allah from it. And whatever your nafs likes for your nafs is from your nafs, so forbid it from it. (Majmoo’ al-Fataawa, 17/529, 530)
i.e., the nafs usually whispers concerning things which are connected to its whims and desires, which people usually like.
Some of the scholars pointed out another important difference, which is that the waswas that comes from the Shaytan makes sin appear attractive until the Muslim falls into it; if the Shaytan is unable to achieve that, he moves on to another sin, and if that does not work he moves on to a third, and so on. He does not care about making the Muslim fall into a particular sin, rather what he cares about is making the Muslim disobey his Lord, and it is all the same to him whether he makes him do something that is forbidden or omit something that is obligatory, for all of it is sin and disobedience. As for the waswas that comes from the nafs, it is what urges the person to commit a specific sin and repeatedly seeks to make him do it.
The Muslim will not be punished for the waswas that comes from the Shaytan or from his own nafs, so long as he does not speak of it or act upon it. But he is commanded to resist it, and if he neglects to resist it and gives in to it, then he will be punished for that neglect.
He is commanded not to pay any attention to the waswas of the Shaytan, and to proceed on the basis of the smaller number (of rak’ahs) in prayer if he is not sure how many he has done. He is commanded to seek refuge from the Shaytan and spit drily to his left three times if the waswas of the Shaytan comes to him whilst he is praying. He is commanded to keep company with good people and avoid bad people. Whoever is negligent with regard to any of these matters will fall into the traps of his nafs which is inclined to evil, or will respond to the devils among the jinn and mankind, in which case he will be held accountable.
As for overwhelming waswas (OCD), it is a kind of sickness – as mentioned above – so the Muslim will not be harmed by it and Allah will not hold him accountable for it, because it is beyond his control. Allah says (interpretation of the meaning):
And the Prophet (peace and blessings of Allah be upon him) said: “Allah will forgive my ummah (followers) for whatever crosses their minds so long as they do not speak of it or act upon it.” Narrated by al-Bukhari, 4968; Muslim, 127
The one who is afflicted with this kind of waswas must always read Quran and recite the dhikrs (words of remembrance) prescribed in sharee’ah (Islamic law), morning and evening. He must strengthen his faith by doing acts of worship and shunning evil. He must occupy himself in seeking knowledge, for although the Shaytan may gain power over a worshipper, he cannot gain power over one who has knowledge.
The Shaytan may come and whisper evil things to a Muslim about Allah, or His Messenger, or His sharee’ah, things that the Muslim hates and does not approve of. The fact that he resists these waswas and hates them is a sign of the soundness of his faith. So he should strive to control his nafs and not respond to the one who calls him to evil.
Ibn Katheer (may Allah have mercy on him) said:
Al-Shaykh ‘Abd al-‘Azeez ibn Baz (may Allah have mercy on him) was asked:
Waswas and ideas may cross a person’s mind, especially to do with tawheed (the oneness of Allah) and faith; will the Muslim be held accountable for that?
It is narrated in al-Saheehayn and elsewhere that the Messenger of Allah (peace and blessings of Allah be upon him) said: “Allah will forgive my ummah (followers) for whatever crosses their minds so long as they do not speak of it or act upon it.” (Agreed upon) And it is narrated that the Sahabah (may Allah be pleased with them) asked the Prophet (peace and blessings of Allah be upon him) about the kinds of waswas and thoughts referred to in the question crossing their minds. He (peace and blessings of Allah be upon him) replied: “That is a clear sign of faith.” (Narrated by Muslim) And he (peace and blessings of Allah be upon him) said: “The people will keep on wondering until it is said, ‘This was created by Allah, but who created Allah?’ Whoever experiences any of that, let him say, Amantu Billaahi wa rusulihi (I believe in Allah and His messengers).’” (Agreed upon) According to another report: “Let him seek refuge with Allah and stop it.” (Narrated by Muslim in his Saheeh)
Tuhfatal-Ikhwan bi Ajwibah Muhimmah tata’allaq bi Arkan al-Islam (question no. 10).
In the answer to question no. 62839, you will find important information on waswasah and the remedy for it.
In the answer to question no. 25778, we have described the remedy for one who is worried about waswas and passing thoughts.
Please see the answer to question no. 12315, for important advice.
And Allah knows best.