Ubayy bin Kaab reported,

There was a man, and I do not know of anyone whose home was farther from the mosque than his, yet he never missed a prayer.Someone said to him, "Why don't you buy a donkey to ride in the dark and over the hot ground?"He replied, "It would not please me for my house to be next to the mosque. I want my walk to the mosque and my return to my family to be recorded for me."The Messenger of Allah ﷺ said, "Allah has gathered all of that for you."

Muslim 1514

Sahih

حدثنا يحيى بن يحيى أخبرنا عبثر عن سليمان التيمي عن أبي عثمان النهدي

عن أبي بن كعب قال

كان رجل لا أعلم رجلا أبعد من المسجد منه وكان لا تخطئه صلاة قال فقيل له أو قلت له لو اشتريت حمارا تركبه في الظلماء وفي الرمضاء قال ما يسرني أن منزلي إلى جنب المسجد إني أريد أن يكتب لي ممشاي إلى المسجد ورجوعي إذا رجعت إلى أهلي فقال رسول الله ﷺ قد جمع الله لك ذلك كله

مسلم 1514صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Mosques and places of prayer
Chapter
Virtue of taking many steps to the mosques
Numbering
Darussalam 1514
Muslim 1514