It was narrated that Abu Raja' said: "I heard 'Imran bin Husain (say) that the Prophet (ﷺ) saw a man who was by himself and did not pray with the people. He said: “O So and so, what kept you from praying with the people?' He said: “O Messenger of Allah, I have become Junub and there is no water.' He said: “You should use earth for that will suffice you”””"
SahihSahihSahih - Agreed UponBook 1 · Hadith 322