Tariq bin Shihab reported,

A man became ritually impure and did not pray. He came to the Prophet ﷺ and mentioned this to him.The Prophet ﷺ said, "You did the right thing."Another man became ritually impure, performed tayammum, and prayed. He came to the Prophet ﷺ, who said to him something similar to what he had said to the other, meaning, "You did the right thing."

Nasai 435

Sahih

أخبرنا محمد بن عبد الأعلى: أخبرنا خالد: حدثنا شعبة أن مخارقا أخبرهم

عن طارق بن شهاب

أن رجلا أجنب فلم يصل فأتى النبي ﷺ فذكر ذلك له فقال: أصبت. فأجنب رجل آخر فتيمم وصلى فأتاه فقال نحوا مما قال للآخر راني أصبت.

النسائي 435صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Ghusl and tayammum
Chapter
Tayammum for one who finds water after prayer
Numbering
Darussalam 435
Nasai 435