All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The existence of such whispers does not undermine the belief of the person as long as he is fully aware of their falsehood and dislikes them. This is evidenced by the report stating that some of the companions once came to the Prophet to consult him, saying, “We have thoughts which none of us dare to talk about.” He said, “Have you experienced that?” and when they replied that they had, he said, “That is clear belief.” [Reported by Muslim]
Commenting on this Hadith, An-Nawawi said, “Not daring to speak with such matters is the true belief, since it indicates your deep fear of even pronouncing it, which means that you would in no way believe in it – all of which are conditions only fulfilled by true believers who cast away all doubts and suspicions.”
As for dealing with such whispers, it should be, first of all, through resorting to Allah, the Almighty, and seeking refuge with Him from them. You should then pay no attention to them at all and direct your thinking instead to something beneficial to fully occupy your mind away from such whispers.
Allah knows best.