آداب قضاء الحاجة
Anas ibn Mālik (may Allah be pleased with him) reported: The Prophet (may Allah's peace and blessings be upon him) used to say before entering the bathroom: O Allah, I seek refuge in You from the male and female devils
عن أنس بن مالك -رضي الله عنه- أن النبي صلى الله عليه وسلم كان إذا دخل الخَلاء قال: ((اللهم إني أَعُوذ بك من الخُبُثِ والخَبَائِث)).
شرح الحديث :
In this Hadīth, Anas ibn Mālik (may Allah be pleased with him), who was honored by serving the Prophet (may Allah's peace and blessings be upon him), mentioned a Prophetic etiquette before answering the call of nature. It expresses the deep love and constant resort of the Prophet (may Allah's peace and blessings be upon him) to his Lord, so much that he never ceased to remember Him and seek His assistance in any situation. When he wanted to enter the place where he would answer the call of nature, he would seek refuge in Allah to protect him against the male and female devils, because they seek to spoil the Muslim's religion and worship all the time and in all conditions. The cause for seeking Allah's refuge is that the bathroom or the lavatory is the home of the devils. The Messenger of Allah (may Allah's peace and blessings be upon him) said: "These privies are frequented by the Jinn and devils. So when anyone goes there, he should say: 'I seek refuge in Allah from the male and female devils.'" [Ibn Mājah and others; classified as Sahīh by Al-Albāni] Another reason involves uncovering one's private parts upon entering such places. The Messenger of Allah (may Allah's peace and blessings be upon him) said: "The screen between the Jinn and the private parts of the children of Adam is saying "In the name of Allah" upon entering the toilet." [Ibn Mājah and others; classified as Sahīh by Al-Albāni]