Sahih Muslim, Book 2, Hadith 81 (Muslim 611)

Abu Qatada reported it from his father that the Messenger of Allah (ﷺ) said:

When anyone amongst you enters the privy he should not touch his penis with his right hand.