Al-Allaamah Rabee Bin Haadee Al-Madkhalee (may Allaah preserve him) said:
The waswaas [whispering of shaytaan] a person encounters can be about Allaah, the Messenger, paradise and hell fire, or it can be about inner evil thoughts that violates Eemaan; so what is its remedy? The person should say:
[أعوذ بالله من الشيطان – I seek refuge in Allaah from shaytaan]. He seeks refuge in Allaah from shaytaan or he says:
[آمنت بالله ورسله — I believe in Allaah and His Messengers], and at the same time he should believe that this waswaas cannot harm him and that (repelling it) is an act of pure Eemaan. This is a testimony from the Messenger (sallal-laahu-alayhi-wasallam) that this whispering (of shaytaan) does not harm and (repelling it) is an act of pure Eemaan.
This is the most severe weapon against shaytaan because (this waswaas) is from his plots; and because he sees that the believer is focused in worship, sincerity and truthfulness, so he puts him to trial through whisperings in his salaah, in his creed and in this and that. Therefore, it is obligatory that one does not submit to these inner thoughts and he should cure them with these words (i.e. seeking refuge in Allaah from shaytaan etc). It is obligated on him to turn away from them and (strive to) busy himself with other thoughts, and then he should seek aid and assistance (from Allaah) to humiliate shaytaan and repel him, saying: “Indeed, the Messenger (sallal-laahu-alayhi-wasallam) testified for me that this is an act of pure Eemaan”.
I said to one of your brothers who said to me: ‘’I am a disbeliever.’’ So, I said to him, ‘’How are you a disbeliever?’’ He said: ‘’I have inner thoughts about such and such.’’ I said to him, ‘’This does not harm you, rather say to shaytaan: ‘Indeed, the Messenger (sallal-laahu-alayhi-wasallam) testified for me that it (i.e. this hatred and fight against this was-waas) is an act of pure Eemaan.'” So, do not be scared and never give it importance. Forget the likes of this (was-waas).’’ This is a remedy given by the Messenger of Allaah (sallal-laahu-alayhi-wasallam) to this Ummah. And if this (waswaas) was harmful, the Messenger (sallal-laahu-alayhi-wasallam) would have clarified it, but it does not harm Inshaa-Allaah.
[Source: السراج الوهاج في التعليق على صحيح الإمام مسلم بن الحجاج –مخطوط- ص : 291-292]