I hope you know the dua for entering the bathroom? If not, learn it now. It’s easy.
Whenever the Prophet went to answer the call of nature, he used to say, “Allah-umma inni a’udhu bika minal khubuthi wal khaba’ith i.e. O Allah, I seek Refuge with You from all offensive and wicked things (evil deeds and evil spirits).”
We seek refuge from these ‘evil spirits’ because they reside at such filthy places. And to protect ourselves from their evil, we seek the Almighty Allah. Who can provide better protection than Him eh?