Anas bin Malik reported,

When the Prophet ﷺ came out of the toilet, he would say, "Praise be to Allah who has removed harm from me and granted me well-being."

Ibn Majah 301

Daif

حدثنا هارون بن إسحق حدثنا عبد الرحمن المحاربي عن إسمعيل بن مسلم عن الحسن وقتادة

عن أنس بن مالك قال

كان النبي ﷺ إذا خرج من الخلاء قال الحمد لله الذي أذهب عني الأذى وعافاني

ابن ماجه 301ضعيف
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Purification and its sunnahs
Chapter
What to say when leaving the toilet
Numbering
Darussalam 301
Ibn Majah 301