Abdullah bin Arqam reported,

The prayer was called to begin, so he took a man by the hand and brought him forward to lead, since this man was the imam of his people. He said, "I heard the Messenger of Allah ﷺ say, 'When the prayer is called and one of you needs to relieve himself, let him begin with relieving himself.'"

Tirmidhi 142

Sahih

حدثنا هناد بن السري حدثنا أبو معاوية عن هشام بن عروة عن أبيه

عن عبد الله بن الأرقم قال

أقيمت الصلاة فأخذ بيد رجل فقدمه وكان إمام قومه وقال سمعت رسول الله ﷺ يقول إذا أقيمت الصلاة ووجد أحدكم الخلاء فليبدأ بالخلاء

الترمذي 142صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Purification
Chapter
When the prayer is called and one of you needs to relieve himself, he should begin with relieving himself
Numbering
Darussalam 142
Tirmidhi 142