The Prophet (peace and blessings of Allah be upon him) said
“The Shaytaan may come to any one of you and say, ‘Who created Allah?’ If any one of you experiences this, let him say, ‘Aamantu billaahi wa rasoolih (I believe in Allah and His Messenger),’ and that will drive him away.” (Saheeh al-Jaami’, 1657). The Messenger of Allah (peace and blessings of Allah be upon him) said: “The Shaytaan may come to any one of you and ask, ‘Who created the heaven?’ and he will say, ‘Allah’ The Shaytaan will say, ‘Who created the earth?’ and he will say, ‘Allah’ Then the Shaytaan will say, ‘Who created Allah?’ If any one of you experiences this, let him say, ‘Aamantu billaahi wa rasoolih.’” (Saheeh al-Jaami’, 1656).
The Prophet (peace and blessings of Allah be upon him) said: “The Shaytaan may come to any one of you, and say, ‘Who created such-and-such? Who created such-and-such?’ until he asks, ‘Who created your Lord?’ If this happens to anyone, let him seek refuge with Allah and let him stop these thoughts.” (Saheeh al-Jaami’, 7993).
The Prophet (peace and blessings of Allah be upon him) said: “Whoever experiences anything of this waswaas, let him say three times, ‘‘Aamantu billaahi wa rasoolih,’ and that will drive (the Shaytaan) away.” (Saheeh al-Jaami’, 6587).
The Prophet (peace and blessings of Allah be upon him) said: “The people will nearly ask too many questions, so that one of them may say, ‘Allah created all of creation, but who created Allah?’ If they say this, then say: ‘Allah is the One, Allah is the Self-Sufficient Master. He begets not, nor was He begotten; and there is none co-equal or comparable unto Him’ [al-Ikhlaas 112:1-4, interpretation of the meaning], and spit (drily) to your left three times, and seek refuge with Allah from the Shaytaan.” (Saheeh al-Jaami’, 8182).
The Prophet (peace and blessings of Allah be upon him) said: “Think about the signs of Allah, do not think about Allah (Himself).” (Saheeh al-Jaami’, 2975)
From these texts we may summarize the following six ways of overcoming these insinuating thoughts:
The person who is experiencing such ideas (waswaas) should say,
“Aamantu billaahi wa rasoolih (I believe in Allah and His Messenger).”
He should seek refuge with Allah from the accursed Shaytaan, and say three times, “A’oodhu billaahi’l-Samee’ il-‘Aleem min al-Shaytaan il-rajeem, min hamzihi wa nafkhihi wa nafathih (I seek refuge with Allah, the All-Hearing, the All-Knowing, from the accursed Shaytaan, and from his slander and evil insinuations).”
He should spit (drily) to his left three times.
He should stop thinking about whatever it is that is on his mind, as the Prophet (peace and blessings of Allah be upon him) said: “Let him stop.” This is an important tactic, because continuing to allow the Shaytaan to influence one in this way can only make it worse. The Muslim must stop these thoughts, as much as he is able, and keep his mind busy with something useful and beneficial.
He should recite Soorat al-Ikhlaas (Qul huwa Allaahu ahad), because it describes attributes of the Most Merciful and is considered to be equivalent to one-third of the Qur’aan. Reciting this great soorah will guarantee an end to these insinuating thoughts.
He should think about the creation and blessings of Allah, not about His nature, because his weak human mind can never comprehend the nature of Allah Allah says (interpretation of the meaning):
“… and they will never compass anything of His Knowledge” [Ta-Ha 20:110]
O' Allah protect us from all kinds of evil and evil deeds.!
Ameen