It is narrated from Sayyidah Aisha (may Allah be pleased with her), she says that when the Prophet (peace and blessings of Allah be upon him) would come out of the toilet, he would say: "O Allah! I ask You for forgiveness."
Hadith Referenceالادب المفرد / كتاب / 693
Hadith Gradingالألبانی:صحيح
Hadith Takhrij«صحيح : أخرجه أبوداؤد ، كتاب الطهارة ، باب ما يقول الرجل إذا خرج من الخلاء : 30 و الترمذي : 7 و النسائي فى الكبرىٰ : 9824 و ابن ماجه : 300»
Explanation & Benefits
Shaykh Maulana Usman Muneeb
Benefits and Issues: A Muslim’s tongue should always remain moist with the remembrance of Allah Ta’ala, but in the place and state of relieving oneself, the remembrance of Allah Ta’ala is neither correct nor appropriate. Therefore, a way has been taught to seek forgiveness for those moments spent in heedlessness: after leaving the toilet, one should seek forgiveness from Allah Ta’ala for any shortcomings.
Source: Fadlullah al-Ahad: Urdu Commentary on al-Adab al-Mufrad, Page: 693