The Messenger of Allah ﷺ said: These privies are frequented by the jinns and devils. So when anyone amongst you goes there, he should say: "I seek refuge in Allah from male and female devils." (Using translation from Abū Dāʾūd 6)
أَنَّ رَسُولَ اللهِ ﷺ قَالَ إِنَّ هَذِهِ الْحُشُوشَمُحْتَضَرَةٌ فَإِذَا دَخَلَ أَحَدُكُمْ فَلْيَقُلْ اللهُمَّ إِنِّي أَعُوذُ بِكَ مِنَ الْخُبُثِ وَالْخَبَائِثِ