Muhammad bin Abdur Rahman bin Thawban reports that the Messenger of Allah (ﷺ) said: "When any one of you touches his private part, he should perform ablution."
Hadith Referenceمسند الإمام الشافعي / كتاب الطهارة / 59
Hadith Takhrijإسناده حسن، أخرجه ابن ماجة: الطهارة، باب الوضوء من مس الذكر (480).