Many etiquettes of the mosques have been mentioned in the hadiths, among them the prohibition of coming to the mosque after eating raw onion and garlic. Spitting in the mosque and spreading filth is forbidden. Likewise, buying and selling in the mosque and announcing a lost item are also prohibited. For whoever leaves his home to go to the mosque, it is recommended that he be in a state of wudu, put his right foot forward first, and recite this supplication:
بِسْمِ اللّٰهِ تَوَكَّلْتُ عَلَى اللّٰهِ لَا حَوْلَ وَلَا قُوَّةَ اِلَّا بِاللّٰهِ
“In the name of Allah, I place my trust in Allah; there is no power to do any good deed and no ability to refrain from any evil deed except through Allah.”
Walking quickly towards the mosques is prohibited. One should go towards the mosque walking at a moderate pace, with great dignity and respect. With every step taken towards the mosque, one’s rank is raised and sins are forgiven. For as long as the worshipper prays and remains sitting in his place of prayer, the angels keep making supplication for him. Therefore the Prophet ﷺ said:
إذا أتيتم الصلاة فعليكم بالسكينة فما أدركتم فصلوا وما فاتكم فأتموا
“When you come to the prayer, walk with calm and tranquility; pray as many rak’ahs as you catch, and complete afterwards those that you missed.”
It is narrated from Hamzah bin Abu Usayd al-Ansari (may Allah be pleased with him) that the Messenger of Allah ﷺ was coming out of the mosque and saw that men and women had mixed together. He said to the women:
فاستأخرن فإنه ليس لكن أن تحققن الطريق عليكن بحافات الطريق
“Stay behind, for you have no right to walk in the middle of the road; walk along the edges of the road.”