كان رسول الله ﷺ إذا دخل الخلاء لبس حذاءه وغطى رأسه
السنن الكبرى للبيهقي
Whenever the Messenger of Allah (SAW) went out to the restroom, He put on his shoes and covered his head.
The Larger Compilation of Stories [Al-sunan Al-kubra] by Al-Bayhaqi