The closer you get to Allah the harder Shaytan attacks so don’t be shocked
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said in Kitab al-Eeman: “The believer may suffer from the whispers of the Shaytan insinuating thoughts of kufr (disbelief), which may make him feel distressed. The Sahabah (may Allah be pleased with them) said, ‘O Messenger of Allah, some of us think thoughts which we would rather fall from heaven to earth than speak of them.’ He said, ‘That is a clear sign of faith.’ According to one report, ‘… thoughts which are too terrible to speak of.’ He said, ‘Praise be to Allah, Who has reduced all his [the Shaytan’s] plots to mere whispers,’ meaning that the fact that these whispers come, but they are so greatly disliked, and they are pushed away from the heart, is a clear sign of faith. This is like the mujahid (warrior) to whom the enemy comes, but he resists him until he overwhelms him, and this is a mighty jihad (battle)… Hence the seekers of knowledge and devoted worshippers experience waswas and doubts which others do not face, because they (the others) are not following the way prescribed by Allah, rather they are following their own whims and desires and neglecting to remember their Lord. This is what the Shaytan wants, in contrast to those who are striving to draw closer to their Lord by seeking knowledge and worshipping Him. He is their enemy and seeks to prevent them from drawing closer to Allah.” (p.147 of the Indian edition)
1. Seek refuge with Allah and give up these thoughts completely, as the Prophet (peace and blessings of Allah be upon him) commanded.
2. Remember Allah and control yourself and do not continue to think of these whispers.
3. Occupy yourself with worship and doing good deeds, in obedience to the command of Allah and seeking to please Him. When you devote yourself completely and seriously to worship, you will forget about these whispers, insha Allah.
4. Frequently seek refuge with Allah and make du’a (supplicate) to free you from these whispers.