Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ibnmajah:299Muḥammad b. Yaḥyá > Ibn Abū Maryam > Yaḥyá b. Ayyūb > ʿUbaydullāh b. Zaḥr > ʿAlī b. Yazīd > al-Qāsim > Abū Umāmah

The Messenger of Allah said: "None of you should fail to say, when he enters his toilet: 'Allahumma inni aʿudhu bika minar-rijsin-najis, al-khabithil-mukhbith, ash-Shaitanir-rajim (O Allah, I seek refuge with You from the filthy and impure, the evil one with evil companions, the accursed Shaitan).'" (Da'if) Another chain with a slightly different wording from Ibn Abi Maryam who mentioned similar, but he did not say in his narration: "Minar-rijsin-najis (From the filthy and the impure)" he only said: "Minal-khabithil-mukhbith, ash-Shaitanir-rajim (From the evil one with evil companions, the accursed Shaitan)."  

ابن ماجة:٢٩٩حَدَّثَنَا مُحَمَّدُ بْنُ يَحْيَى حَدَّثَنَا ابْنُ أَبِي مَرْيَمَ حَدَّثَنَا يَحْيَى بْنُ أَيُّوبَ عَنْ عُبَيْدِ اللَّهِ بْنِ زَحْرٍ عَنْ عَلِيِّ بْنِ يَزِيدَ عَنِ الْقَاسِمِ عَنْ أَبِي أُمَامَةَ

أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ: «لاَ يَعْجِزْ أَحَدُكُمْ إِذَا دَخَلَ مِرْفَقَهُ أَنْ يَقُولَ (اللَّهُمَّ إِنِّي أَعُوذُ بِكَ مِنَ الرِّجْسِ النَّجَسِ الْخَبِيثِ الْمُخْبِثِ الشَّيْطَانِ الرَّجِيمِ)»  

قَالَ أَبُو الْحَسَنِ وَحَدَّثَنَا أَبُو حَاتِمٍ حَدَّثَنَا ابْنُ أَبِي مَرْيَمَ فَذَكَرَ نَحْوَهُ وَلَمْ يَقُلْ فِي حَدِيثِهِ مِنَ الرِّجْسِ النَّجَسِ إِنَّمَا قَالَ (مِنَ الْخَبِيثِ الْمُخْبِثِ الشَّيْطَانِ الرَّجِيمِ)

See similar narrations below:

Collected by Ṭabarānī
tabarani:7849Yaḥyá b. Ayyūb > Saʿīd b. Abū Maryam > Yaḥyá b. Ayyūb > ʿUbaydullāh b. Zaḥr > ʿAlī b. Yazīd > al-Qāsim > Abū Umāmah

[Machine] The Messenger of Allah ﷺ said, "None of you should be unable, when entering his companion's armpit, to say: 'O Allah! I seek refuge in You from the impure, filthy, evil, wicked Satan.'"  

الطبراني:٧٨٤٩حَدَّثَنَا يَحْيَى بْنُ أَيُّوبَ ثنا سَعِيدُ بْنُ أَبِي مَرْيَمَ ثنا يَحْيَى بْنُ أَيُّوبَ عَنْ عُبَيْدِ اللهِ بْنِ زَحْرٍ عَنْ عَلِيِّ بْنِ يَزِيدَ عَنِ الْقَاسِمِ عَنْ أَبِي أُمَامَةَ قَالَ

قَالَ رَسُولُ اللهِ ﷺ لَا يَعْجِزَنَّ أَحَدَكُمْ إِذَا دَخَلَ مِرْفَقَهُ أَنْ يَقُولَ اللهُمَّ إِنِّي أَعُوذُ بِكَ مِنَ الرِّجْسِ النَّجِسِ الْخَبِيثِ الْمُخْبِثِ الشَّيْطَانِ الرَّجِيمِ