He used to lead his companions in prayer. One day the time for prayer arrived, but he went off to relieve himself and then returned, saying, "I heard the Messenger of Allah ﷺ say, 'When one of you needs to relieve himself, let him do so before the prayer.'"
أنه كان يؤم أصحابه، فحضرت الصلاة يوما، فذهب لحاجته ثم رجع، فقال: إني سمعت رسول الله ﷺ يقول: إذا أراد أحدكم الغائط فليبدأ به قبل الصلاة.
Malik reported it in the chapter on shortening the prayer while traveling (49), from Hisham bin Urwa, from his father, from Abdullah bin Arqam, and he related the hadith.In the Sunan works, it says, "If one of you needs to relieve himself while the prayer has been called, let him attend to that first." Abu Dawud (88), Tirmidhi (142), Nasai (2/110), and Ibn Majah (616) all narrated it through the route of Hisham bin Urwa with this same chain. Tirmidhi said, "The hadith of Abdullah bin Zayd bin Arqam is hasan sahih." Ibn Khuzayma (932) and Ibn Hibban (2071) also graded it sahih, as did Hakim (1/168), all from this same route. Hakim said, "It is sahih according to the standard of the two Shaykhs (Bukhari and Muslim)."