The Messenger of Allah ﷺ said: When anyone amongst you wakes up from sleep at night, he should not put his hand in the utensil until he has washed his hand three times, for he does’ not know where his hand was during the night. (Using translation from Abū Dāʾūd 103)
قَالَ رَسُولُ اللهِ ﷺ إِذَا اسْتَيْقَظَ أَحَدُكُمْ مِنَ اللَّيْلِ فَلَا يُدْخِلْ يَدَهُ فِي الْإِنَاءِ حَتَّى يَغْسِلَهَا ثَلَاثَ مَرَّاتٍ فَإِنَّهُ لَا يَدْرِي أَيْنَ بَاتَتْ يَدُهُ؟