Question:
How can I protect myself from the evil of Satan in the mosque?
Answer:
It is narrated from Abu Hurairah (may Allah be pleased with him) that the Messenger of Allah ﷺ said:
«إذا دخل أحدكم المسجد فليسلم على النبى صلى الله عليه وسلم، وليقل: اللهم افتح لي أبواب رحمتك. وإذا خرج فليسلم على النبى صلى الله عليه وسلم، وليقل: اللهم اعصمني من الشيطان الرجيم»
“When any one of you enters the mosque, let him invoke peace upon the Prophet ﷺ and say: «اللهم افتح لي أبواب رحمتك»; and when he leaves, let him invoke peace upon the Prophet ﷺ and say: «اللهم اعصمني من الشيطان الرجيم»”
Reference: Sunan Ibn Majah, Hadith no. 773