I.
What will put an end to waswas (whispers from the Shaytan; intrusive thoughts) is striving to learn what Allah, may He be Exalted, and His Messenger (blessings and peace of Allah be upon him) prescribed for ridding oneself of the whispers of the Shaytan, then follow that prescription.
We are afraid that your question could be one of the tricks of the Shaytan, and that he wants to deceive you by means of this question and prevent you from learning about what the Messenger (blessings and peace of Allah be upon him) taught us about knowledge and actions that may be of benefit for ridding oneself of waswasah by Allah’s leave.
The correct thing to do in all cases is to seek the answer or remedy by learning what Allah has prescribed for various issues, then accept it and strive to follow it and implement it. It is not what a person may think or assume, that the particular answer to a particular question is what is beneficial for him and no one else.
Moreover, he should not decide that he is being pathologically afflicted by intrusive thoughts unless that is based on the diagnosis of a specialist. The matter may be less serious than that, such as if what he is dealing with is mere conjecture or doubts and the like, that could be eliminated through acquiring knowledge or by taking some measures. For more information, please see the answers to questions no. 39684 and 319142.
As for the Shaytan, his ultimate goal for which he is striving all times, is to spread mischief and corruption on earth and lead people away from the natural inborn inclination of man to worship his Creator that Allah has instilled in them and thus prevent them from obeying Allah, may He be Exalted, and worshipping Him, and misguide them so that they will disobey Allah and associate others with Him (shirk).
Thus the Shaytan strives hard, at all times, to achieve this goal to which he has devoted himself and has made it his mission to spread mischief and corruption, for he is the one who bids people to commit immoral actions, bars people from the path of Allah and causes grief to the believers, and he is the one who confuses them about their religion through his whispers and making them doubt their faith and their righteous deeds.
The Shaytan cannot achieve this goal except through lies, because lies lead to wickedness. As for truthfulness, it leads to guidance and righteousness, as the Prophet (blessings and peace of Allah be upon him) said: “Truthfulness leads to righteousness, and righteousness leads to Paradise. A man may speak the truth until he is recorded with Allah as a speaker of truth. Lying leads to wickedness and wickedness leads to Hell. A man may tell lies until he is recorded with Allah as a liar.” Narrated by al-Bukhari, 6094; and Muslim, 2607.
The Shaytan usually lies and lies a great deal, and his words are non-stop lies, because he lives to spread mischief and corruption, as noted above. The Prophet (blessings and peace of Allah be upon him) has told us that he is an inveterate liar in the hadith which was narrated by al-Bukhari (5010). Al-Hafiz Ibn Hajar said in his commentary on the word kadhub (inveterate liar): His habit is to lie constantly. Fat-h al-Bari, 9/56.
II.
The Shaytan is an inveterate liar whose habit is to lie persistently, but he may tell the truth on rare occasions, mixed with a lot of lies. He only does that to deceive and delude, and to achieve his ultimate goal of spreading mischief and corruption and barring people from the path of Allah.
The Messenger of Allah (blessings and peace of Allah be upon him) has explained that as he said:
“When Allah decrees a matter in heaven, the angels beat their wings in submission to His words, making a sound like a chain striking a rock. When the fear is banished from their hearts, they say: What is it that your Lord has said? They say: The truth, and He is the Most High, the Most Great. Then the one who is listening out hears that, and those who are listening out are standing one above the other.” Sufyan [one of the narrators] demonstrated with his hand, holding it vertically with the fingers outspread. “So he hears what is said and passes it on to the one below him, and that one passes it to the one who is below him, and so on until it reaches the lips of the soothsayer or fortune-teller. Maybe the meteor will hit him before he can pass anything on, or maybe he will pass it on before he is hit. He tells a hundred lies alongside it, but it will be said: Did he not tell us that on such and such a day, such and such would happen? So they believe him because of the one thing which was heard from heaven.” Narrated by al-Bukhari, 4800.
The Shaytan’s occupation is to lie, and lies are his stock in trade, but he may speak a word of truth, mixing it with one hundred lies or more, so that the people who are deceived by him and those who follow him, namely the practitioners of witchcraft and soothsayers, and their followers, will believe it, as is explained in the hadith “So they believe him because of the one thing which was heard from heaven” – that is, he is believed in the hundred or more lies that he tells because of one word of truth, that he snatched when eavesdropping on news from heaven, in the midst of all these lies.
When some people asked the Messenger of Allah (blessings and peace of Allah be upon him) about soothsayers, the Messenger of Allah (blessings and peace of Allah be upon him) said: “They are nothing.” They said: O Messenger of Allah, sometimes they tell us something that turns out to be true. The Messenger of Allah (blessings and peace of Allah be upon him) said: “That is a word of truth that the jinni snatches, and he cackles it into the ear of his familiar as a hen cackles, but they mix more than a hundred lies with it.”. Narrated by al-Bukhari, 6213; and Muslim, 2228.
It was narrated that `A’ishah said: I said: O Messenger of Allah, the soothsayers used to tell us things that we would find to be true. He said: “That is a true word that the jinni snatches and throws into the ear of his familiar, but he adds a hundred lies to it.”
What is meant in all of that is the disbelievers among the jinn, who are the devils (shayatin).
The Shaytan may whisper to a person by telling him something that is true in order to spoil his worship by making him confused, causing him to doubt and whispering intrusive thoughts to him. The Messenger of Allah (blessings and peace of Allah be upon him) also explained that to us when he said:
“When the call to prayer is given, the Shaytan runs away breaking wind loudly so that he will not hear the call. Then when the call has ended, he comes but when iqamah (final call before prayer) for prayer is given he runs away, then when the iqamah has ended, he comes back so that he can whisper to the individual, saying: Remember such and such, remember such and such -- about things that he was not thinking about, until he confuses the man and he does not know how many rak`ahs he has prayed.” Narrated by al-Bukhari, 608; and Muslim, 389.
According to a report narrated in Sahih Muslim: “He causes him to remember good things, makes him hopeful, and reminds him of things that he needs to do that he had forgotten.”
Thus we know that the Shaytan whispers to the worshipper during his prayer by reminding him of some thing or some place which he used to know but had forgotten about, or he did not know, so that he will think about it, until he forgets the number of rak`ahs he has prayed. This is one of the most common types of waswas (whispers from the Shaytan).
Al-Hafiz Ibn Hajar said: He reminds him of things that he was aware of before in order to distract him, and mentions to him things that never happened before, so as to occupy his mind with them.
This is not limited to thinking of worldly matters or religious matters, such as issues of knowledge, only.
End quote from Fat-h al-Bari, 2/86.
This is one of the tricks that the Shaytan uses to bar people from the path of Allah, as a result of which a person may find himself controlled by intrusive thoughts and confusion, and unable to focus on his worship.
Al-Bukhari (2311) narrated the story of Abu Hurayrah with the devil who was stealing from the collected zakah of Ramadan and every time Abu Hurayrah said: I will surely take you to the Messenger of Allah (peace and blessings of Allah be upon him), the devil lied and said to him: I am in need; I have dependents and am in great need… until Abu Hurayrah said to him the third time: I will surely take you to the Messenger of Allah (peace and blessings of Allah be upon him); this is the last of three times. Every time you say you will not come back, then you come back.
When the devil realized that Abu Hurayrah was not going to let him go, and he was going to hand him over to the Messenger of Allah (blessings and peace of Allah be upon him), which would be a great calamity for him, to be brought before the Prophet (blessings and peace of Allah be upon him), at that moment he spoke a word of truth, after having persistently lied as was his wont, in order to save himself from this calamity. So he told Abu Hurayrah that reciting Ayat al-Kursiy before going to sleep would protect a person from devils coming near him until morning.
The Prophet (blessings and peace of Allah be upon him) said to Abu Hurayrah: “He spoke the truth, even though he is an inveterate liar.”
Ibn Hajar said: “He spoke the truth, even though he is an inveterate liar” is a clarification, because the Prophet’s praise (“He spoke the truth”) may give the impression that he was describing him as someone who was truthful, so he followed that by affirming that he was not truthful, using an emphatic form of the word (translated here as “an inveterate liar”). What is meant is: he told you the truth in this instance, even though by habit he is an inveterate liar.
End quote from Fat-h al-Bari, 9/56.
Thus it becomes clear that this devil only spoke the truth after telling many lies so that he could save himself from being handed over to the Messenger of Allah (blessings and peace of Allah be upon him), for he only speaks the word of truth after mixing it with a lot of lies so that he will be able to make his lies palatable in the future and continue to spread mischief and corruption. We seek refuge with Allah from the accursed Shaytan, for he is an inveterate liar whose stock in trade is lies and wickedness.
For more information on overcoming waswas, please see the answers to questions no. 210592, 175303 and 20159.
And Allah knows best.