It is narrated from Sayyiduna Anas (may Allah be pleased with him) that when the Messenger of Allah (peace and blessings be upon him) intended to enter the toilet, he would say: "'A'udhu billahi min al-khubuthi wa al-khaba'ith' (I seek refuge in Allah from the male and female evil ones)."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 453