Salam,
There are some etiquette that we must pay attention to and do from before leaving until when we are in the mosque, including:
1. Pray when you go to the mosque
Hadith of Ibn Abbas, "It is the Messenger of Allah when he went out (from home) to pray (at the mosque) praying, 'O Allah, make light in my heart, and light in my tongue, and make light in my hearing, and make light from behind me, and light in my ears. from before me, and make light from above me and light from below me. O Allah, grant me light from below me. O Allah, grant me light'," (Muttafaq'alaih)
2. Walk to the mosque to pray quietly and solemnly
The Messenger of Allah said, "When the prayer is finished, do not come to it running, but come to it walking and paying attention to tranquility. So what (part of prayer) you find, follow it and what is left, complete it." (Muttafaq'alaih)
3. Pray when entering and leaving the mosque
It is sunnah for people who enter the mosque to put their right foot first, then pray to the Prophet and say "O Allah, open for me the doors of your mercy."
4. It is sunnah to perform the Tahiyatul Masjid prayer when you enter the mosque
The Messenger of Allah said, "When anyone of you enters the mosque, he should pray two rak'ahs before sitting down." (Muttafaq'alaih)
5. It is forbidden to buy and sell and announce lost items in the mosque
Based on the words of the Prophet, "When you see people selling or buying something in the mosque, then pray, 'May Allah not benefit you'. And when you see a person who announces a lost item, then pray, 'May Allah not return your lost item'," (HR At-Turmudzi and authenticated by Al-Albani)
6. It is forbidden to enter the mosque for people to eat garlic, onions, or people whose bodies are not delicious
The Messenger of Allah said, "Whoever eats garlic, onion, or leek, then do not ever come near to our mosque, because the angels feel disturbed from what humans are disturbed," (HR Muslim)
7. It is forbidden to leave the mosque after the call to prayer
The Messenger of Allah said, "When the muezzin has the call to prayer, then no one should go out before praying," (HR Al Baihaqi and authenticated by Al-Albani)
8. Do not pass in front of people who are praying
And it is sunnah for those who pray to put a limit in front of them. The Messenger of Allah said, "If the one who passed in front of the one who was praying knew the sin of what he had done, he would have stood at a distance of forty that would be better than passing in front of him." (Muttafaq'alaih)
9. Do not make the mosque as a way (enter the mosque only through without praying)
The Messenger of Allah said, "Do not make the mosque a way, except (as a place) for dhikr and prayer," (HR At Tabrani, judged as hasan by Al Albani)
10. Does not filter the sound in the mosque and does not disturb people who are praying
In the mosque it is not allowed to make loud noises, because it can interfere with the solemn worship of others. Likewise, activating the cellphone during prayer.
11. Women should not wear perfume or make up when going to the mosque
The Messenger of Allah said, "If any of you (women) want to pray in the mosque, then do not touch perfume." (Muslim)
12. People who are junub, menstruating or postpartum women are not allowed to enter the mosque
Allah says, "(And do not approach the mosque), while you are in a state of junub, except just passing by, until you take a bath," (Surah An Nisa: 43)
'Aisha narrated that the Messenger of Allah had said to her, "Bring me a mat from the mosque." Aisha replied, "Indeed I am menstruating." The Prophet said, "Indeed, your period is not in your hands." (Muslim)