It was narrated from Ibn 'Abbas that: The Prophet got up during the night and went to the toilet and relieved himself, then he washed his face and hands, and went back to sleep. (Sahih) Another chain with similar wording.
The Prophet Muhammad's actions demonstrate how important it is for Muslims to be mindful of their personal hygiene habits at all times, even when performing simple tasks like using a toilet. By following his example, Muslims can ensure that they remain pure and clean both inside and out.