Anas ibn Malik reported: When the Prophet, peace and blessings be upon him, entered the washroom, he would say, “O Allah, I seek refuge in you from wicked and noxious things.”

Source: Ṣaḥīḥ al-Bukhārī 142, Ṣaḥīḥ Muslim 375

Grade: Muttafaqun Alayhi (authenticity agreed upon) according to Al-Bukhari and Muslim

عَنْ أَنَسِ بْنِ مَالِكٍ قَالَ كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِذَا دَخَلَ الْخَلَاءَ قَالَ اللَّهُمَّ إِنِّي أَعُوذُ بِكَ مِنْ الْخُبُثِ وَالْخَبَائِثِ