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, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
You should know that these thoughts do not affect the soundness of your faith, and they do not take you out of the fold of Islam. You have to ignore them completely and not give them any attention. This is the best way to get rid of them, Allah willing.
Allah knows best.