From Sahih Muslim (Hadith 831):
Anas reported:When the Messenger of Allah (ﷺ) entered the privy, and in the hadith transmitted by Hushaim (the words are): When the Messenger of Allah (ﷺ) entered the lavatory, be used to say: O Allah, I seek refuge in Thee from wicked and noxious things
Reference: Muslim 831