If it’s your nafs stop the habit and replace it with a good habit as Allah (Subhanahu wa Ta’ala) said: “And establish prayer at the two ends of the day and at the approach of the night. Indeed, good deeds do away with misdeeds. That is a reminder for those who remember.” (Surah Hud Verse 114)
It is important to educate ourselves about the sin or reflect upon the detrimental habit and then think about the akhirah.
To fight Shaitan’s whispers, Allah Subhanahu Wa Ta’ala gave us a strong system of defense and the best of it is our faith:
Increase in Knowledge
The Qur’an and Sunnah are our reference and guides for knowing what is permitted and forbidden in life as Muslims, it is therefore an obligation to learn about Allah Subhanahu Wa Ta’ala and thus increasing in our pursuit of knowledge strengthens our faith. We should also turn to scholars when in doubt or needing clarification. Try to read The Noble Qur’an, ahadith, various books about Islam to increase your eman to put into practice, and to increase your reliance of Allah Subhanahu Wa Ta’ala as that knowledge will bithn’illah be your protection next time Shaitan tries to make you deviate.
Rely on Allah
Know that there is no might nor power except with Allah Subhanahu Wa Ta’ala and without Him you can not succeed.
Seeking Refuge: Al-Istiadah
Sincerely seek refuge with Allah from the accursed; do so before entering the toilet, entering your house, when leaving the house, when having bad thoughts, when beginning to recite The Qur’an, so on.
Make du’a for help and protection, and find the Sunnah du’a which can be found in the supplication book Fortress of the Muslim.
Remembrance of Allah:
Abu Hurairah (May Allah be pleased with him) reported: The Messenger of Allah (sal Allahu ‘alayhi wa sallam) said, “Allah the Exalted says: `I am as my slave expects me to be, and I am with him when he remembers Me. If he remembers Me inwardly, I will remember him inwardly, and if he remembers Me in an assembly, I will remember him in a better assembly (i.e. in the assembly of angels).”
[Al-Bukhari and Muslim].
Read, Recite, Reflect on the Qur’an:
You can listen to the Qur’an on your mobile phone, your iPod or MP3, or in your car, on your way to work or school or at home. Make a habit of reading the Qur’an daily, even if it is just a few verses. It is our source of guidance and protection for our eman.
Finally, Shaitan is our enemy and let us wage a war against him and our nafs by devoting ourselves to increasing our eman and serving Allah Subhanahu Wa Ta’ala. At the end of the day, Shaitan does not make us do something, he whispers. If you fall, which we are all bound to do as humans, don’t give up and turn back to Allah Subhanahu Wa Ta’ala:
Say: ”O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allah. Indeed, Allah forgives all sins. Indeed, it is He who is the Forgiving, the Merciful.” (Az-zumur 53)