Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states the following:
“Evil thoughts could very well be whisperings of Satan. Whenever such thoughts occur to you as a Muslim, you must turn your attention immediately away from them by seeking refuge in Allah (by saying: “A`udhu billahi mina ash-shaytani-r-rajim; I seek refuge and protection in Allah from Satan, the accursed”). The Prophet (peace and blessings be upon him) said, “Allah has forgiven my Ummah of the whisperings of their souls so long as they do not talk about it or act accordingly.”
To explain this further, our thoughts can be divided into different categories: 1) the constant self-talk or idle thoughts that assail our minds over which we have no control; 2) thoughts that we dwell on; 3) intentions that we formulate based on those thoughts. We are not accountable for the first stage, namely the self-talk unless we dwell on them and nurture them in our minds, since we have no control over them. We are accountable if we dwell on them as well as for the deliberate intentions that we formulate based on these thoughts.
Having said this, it is also crucial for us to consider the treacherous nature of our hearts (more precisely our souls) and must exercise vigilance against them. The Prophet (peace and blessings be upon him) taught us that “Hearts are ever changing.” The word “qalb” in Arabic means twisting and turning. So we must take care to dismiss and reject bad thoughts that assail our hearts and minds by ever turning to Allah for refuge and protection. We must also recognize that ultimately we have no power to master these evil inclinations except through the help of Allah. The remedy and cure therefore lies in consistency in dhikr (remembrance of Allah) and istighfar (seeking Allah’s forgiveness).
The Prophet (peace and blessings be upon him) taught us the following du`a’s (supplications) to master the evil inclinations of our souls, and, accordingly, these must form part of the daily spiritual regimen of every believer:
Allahumma ya muqalliba al-qulub thabbit qalbi `ala dinika. (O Allah, O You Who are the twister of hearts, so make my heart firm and steadfast on Your religion).
Rabbi a`udhu bika min hamazati ash-shayatin.
(My Lord, I seek Your refuge and protection against the whisperings of devils).
Finally, read the Sayyid al-Istighfar (master supplication for forgiveness) in the morning as well as before retiring to bed: Allahumma, anta rabbi, la ilaha illa anta; khalaqtani wa ana `abduka, wa ana `ala `ahdika wa wa`dika ma istata`tu; a`udhu bika min sharri ma sana`tu; abu’u laka bi ni`matika `alayya wa abu’u bi dhanbi; fa ighfir li, fa innahu la yaghfiru al-dhunuba illa anta. (O Allah, You are my Lord, there is no god but You; You have created me, and I am Your servant, and I stand firm on my covenant with You according to the best of my ability; I seek refuge in You from the evils of my own actions; I acknowledge Your favors upon me and I confess my sins to You; so forgive me, for no one has power to forgive sins except You.)
Finally, examine yourself, and see if you have been guilty of any major sins; if you have been, make sincere repentance to Allah from all of them without delay.”
Moreover, Sheikh Kutty adds:
Anxiety and worry can be overcome by seeking refuge in Allah through consistency in dhikr. As Imam Ibn Al-Qayyim has pointed out, dhikr entails manifold benefits, the most important of which is that it brings us closer to Allah while keeping us away from Satan, who whispers all kinds of thoughts and suggestions in our minds and hearts. The next most important benefit of dhikr is that it removes all feelings of grief, worry, and anxiety from our hearts and bestows on our souls true serenity, joy, peace, and bliss. Allah says, ( Those who believe and whose hearts find tranquility in the remembrance of Allah. Lo, it is in the remembrance of Allah that hearts find tranquility) (Qur’an: Ar-Ra`d 13:28).
We also read that the Prophet (peace and blessings be upon him) used to look expectantly towards Prayer (being the perfect means of dhikr) as the true source of bringing joy to the heart. He said, “The true joy of my heart is in Prayer.” It is also worth remembering that, according to Islam, Allah alone is the Ultimate Source of Peace; His name is As-Salam.
Therefore, I advise to practice dhikr consistently so that it becomes your second nature. This can be achieved through consistency: The first step is to be diligent in performing your salah consistently and regularly at the appointed times, while being fully awake and mindful of the meanings and feeling the true spirit of it. Second, condition yourself to turn to Allah always in du`aa’ (suplication) and istighfar (seeking Allah’s forgiveness).