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.