The Cure for Satanic Thoughts
Question:
Sometimes dangerous notions and ideas come into my mind and I fear that they may remove me from the pale of my religion; what can I do about them?
Answer:
These notions and thoughts are from Satan, who whispers into the hearts of mankind in order to cause confusion to the Muslim; so when you feel any such thing, seek refuge with Allah and stop thinking about matters of the unseen, matters of (Allah's) Attributes and creation, so that your conviction is not weakened.
Source:
Ibn Jibreen
Fatawa Islamiyah, Vol. 1 Page 224