Sunan Abi Dawud, Book 1, Hadith 386 (Abu Dawud 386)

Abu Hurairah reported the tradition to the same effect from the Prophet (ﷺ):

When any of you treads with his shoes upon something unclean, they will be purified with the earth.