Ahsanallahu Ilaikum ustadh, how can I avoid ending up in a situations where I commit sins or mistakes unknowingly becuz of circumtances becuz I forgot about being cautious about it? Is there any dua I can avoid these kinds of bad situations? Like backbiting or speaking inappropiately by mistake?

Ustadh AbdulAziz al-Haqqan
Accustom yourself akhi, there are many duas asking Allah to protect us from the evils of ourselves. Also occupy your tongue with istighfar and tasbeeh etc... This will help in reducing that and stopping altogether