How do I deal with distressing thoughts about Allah, the Messenger, and Islam that are horrible and kufri? And while I pray, I get images of shirk and such in sujood which makes me restart praying, and when I make dua i get such images which makes me stop supplicating, these make me say the shahada.

Ustadh AbdulAziz al-Haqqan
This is not about the bad thoughts; this sounds like compulsive thoughts or OCD to me, which is called Waswas in Arabic. You need to tackle that first and work on that first. So if you think you need to go to a psychologist or a psychiatrist, then do so. Barakallahu feek.