The shortest instruction in the tradition
The report below is what was given for the worst version of this, the doubt that comes for God Himself. Seek refuge, and turn away. Not argue. Not resolve. Turn away.
Qur’an and Sunnah
مِن شَرِّ ٱلۡوَسۡوَاسِ ٱلۡخَنَّاسِ
against the harm of the slinking whisperer––
Qur’an 114:4
ٱلَّذِي يُوَسۡوِسُ فِي صُدُورِ ٱلنَّاسِ
who whispers into the hearts of people––
Qur’an 114:5
(It is narrated on the authority of Abu Huraira that the Messenger of Allah may peace be upon him) observed:The Satan comes to everyone. of you and says: Who created this and that? till he questions: Who created your Lord? When he comes to that, one should seek refuge in Allah and keep away (from such idle thoughts)
Sahih Muslim 134graded sound, sahihaynfull report
Translation: M.A.S. Abdel Haleem, The Qur'an, Oxford University Press, 2004.
What the research says
Saeed SI, Ahmed JO, Kakamad K, Najmadden Z (2024). Abu Zayd Ahmed ibn Sahl Al-Balkhi (850 to 934): a pioneer in the field of psychotherapy and mental health. Cureus, 16(8), e67998 doi
Al-Balkhi identified al-waswasah with what would now be called obsessions and compulsions, and set it out as a condition to be treated rather than a moral failing, roughly a thousand years before the modern category existed.
Inozu M, Karanci AN, Clark DA (2012). Why are religious individuals more obsessional? The role of mental control beliefs and guilt in Muslims and Christians. Journal of Behavior Therapy and Experimental Psychiatry, 43(3), 959 to 966 doi
Where high religiosity went with more obsessional symptoms, in Muslim and Christian samples alike, the route ran through beliefs about needing to control one's thoughts and through guilt, rather than through religiosity itself.