Whenever the Prophet (ﷺ) went to answer the call of nature, he used to say, "Allah-umma…

Sahih al-Bukhari Book 4 Hadith 8

Sahih al-Bukhari #142

Ablutions (Wudu') 4:8

Narrated Anas:

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).

Chapter: What to say while going to the lavatory (water closet)

Grade: Sahih