The Messenger of Allah (ﷺ) instructed to recite this dua while leaving the mosque:
اَللَّهُمَّ أَجِرْنِيْ مِنَ الشَّيْطَانِ الرَّجِيْمِ
Pronunciation
Allaahumma ajirni minash shaitaanir rajeem
Meaning
O Allah, protect me from Satan the outcast.
Source: Sahih (Ibn Hibban). Ibn Hibban: 2047
Duas from IslamicAPI's Masnun Dua dataset (based on the Quran, hadith, Hisnul Muslim and Rahe Belayat). See the dataset