When you get such doubts, challenge Shaytan and go back to the basics. Go back to certainty. Hold on to what you know and fight him with that.
Also, seek refuge in Allah for the accursed Satan.
Also recite this Dua:
سبحان الله ملء سماواته وأرضه، ومداد كلماته، وزنة عرشه، ورضا نفسه
And this Dua:
آمنت بالله ورسوله مخلصا له الدين
You may also see this video:
42- (17) Usul al-Kafi – Protecting Oneself from Doubts – Sayed Mohammad Baqer Qazwini
https://youtu.be/JqOgaN_GO3o