The Messenger of Allah ﷺ said, "When one of you enters the toilet, he should not touch his private part with his right hand."
أخبرنا هناد بن السري عن وكيع عن هشام عن يحيى هو ابن أبي كثير
قال رسول الله ﷺ إذا دخل أحدكم الخلاء فلا يمس ذكره بيمينه
[Agreed upon by Bukhari and Muslim. See the previous hadith. It is also found in Kubra, hadith no. 29.]