[Machine] Narrated by the Prophet ﷺ , the good word is a form of charity, and walking to the mosque is a form of charity. This was also narrated by Abdur-Razzaq from Ma'mar, who said in the narration: Every step taken towards the prayer is a form of charity. They both compiled it in Sahih Al-Bukhari and Sahih Muslim, and it is mentioned in the last chapter of the book of Zakat, with the will of Allah.
عَنِ النَّبِيِّ ﷺ قَالَ الْكَلِمَةُ الطَّيِّبَةُ صَدَقَةٌ وَمَشْيُكَ إِلَى الْمَسْجِدِ صَدَقَةٌ وَرَوَاهُ عَبْدُ الرَّزَّاقِ عَنْ مَعْمَرٍ فَقَالَ فِي الْحَدِيثِ وَكُلُّ خُطْوَةٍ يَمْشِيهَا إِلَى الصَّلَاةِ صَدَقَةٌ وَمِنْ ذَلِكَ الْوَجْهِ أَخْرَجَاهُ فِي الصَّحِيحَيْنِ وَهُوَ مُخَرَّجٌ فِي آخِرِ كِتَابِ الزَّكَاةِ بِمَشِيئَةِ اللهِ