It was narrated from Abu Hurairah that the Prophet (ﷺ) said:
"When a man goes out of his house to his Masjid, one foot records a good deed and the other erases a bad deed."