The Messenger of Allah ﷺ said, "Whoever purifies himself in his home, then walks to one of the houses of Allah to fulfill an obligation from among the obligations of Allah, his two steps are such that one of them erases a sin and the other raises him a degree."
قال رسول الله ﷺ: من تطهر في بيته ثم مشى إلى بيت من بيوت الله ليقضى فريضة من فرائض الله، كانت خطوتاه إحداهما تحط خطيئة، والأخرى ترفع درجة.
Muslim narrated it in "The Mosques" (666) via Adi bin Thabit, from Abu Hazim Ashjai, from Abu Hurairah, and he mentioned it.