Ala Hazrat Imam Ahmad Rida Khan (Allah is pleased with him) recommended many ways to stay away from satanic whispers (waswasa), which can sometimes take over people's lives and harass them incredibly.
If a person practices upon these remedies with firm faith then there is no doubt that Shaytan will be disgraced and his whisperings will have no effect.
Ala Hazrat recommends the following methods:
1) Returning to Allah (obedience)
2) Reciting أَعُوْذُ بِاللهِ مِنَ الشَّيْطَانِ الرَّجِيْم
3) Reciting لا حَوْلَ و لا قُوَّةَ إلَّا بِالله
4) Reciting Surat al-Nas
5) Saying اٰمَنْتُ بِاللهِ و رَسُوْلِه
6) Reciting the following verse will instantly remove all satanic whispers -
هُوَ الأَوَّلُ و الآخِرُ وَالظّـٰهِرُ و البَاطِنُ و هُوَ بِكُلِّ شَيْءٍ عَليْم
7) Reciting the following in abundance will remove such whispers from their roots -
سُبْحَانَ المَلِكِ الخَلَّاقْ . إِن يَشَأْ يُذْهِبْكُمْ وَيَأْتِ بِخَلْقٍ جَدِيْدٍ . وَمَا ذَٰلِكَ عَلَى اللهِ بِعَزِيْزٍ
It says in a Hadith that a companion came to the blessed court of the Prophet Muhammad ﷺ and complained that he can't remember whether he prayed 2 or 3 Rakats in Salah.
The Prophet ﷺ stated:
اذا وجدت فارفع اصعبك السبابة اليمنى فاطعنه في فندم اليسرى و قل باسم الله فإنها سكين الشيطان
When you find yourself in such a situation then lift the index finger of your right hand and hit it on your thigh for this is a dagger for the devil.
Reference: Fatawa Ridawiyyah, V1 Page 770
Compiled by Sayyid Ali al-Amjadi