From Aboo Umaamah [رضي الله عنه]: from the Prophet [ﷺ] that he said:

❝Whoever goes out to the mosque, not intending except to learn some good or to teach it, then for him shall be the reward of a person who has performed Hajj, whose Hajj is complete.❞

[Reported By At-Tabaraanee In Al-Mu`Jamul-Kabeer, (8/111, No. 7473) | Shaykh Al-Albaanee: ‘Saheeh’ In Saheehut-Targheeb, (No. 82) | Translated By Abū Talhah Dāwood Ibn Ronald Burbank]