The Prophet ﷺ said, "When one of you goes to his bed, let him dust off his bed with the inner part of his lower garment, for he does not know what may have come upon it after he left it. Then let him say, 'In Your name, my Lord, I lay down my side, and by You I raise it. If You take my soul, have mercy on it, and if You send it back, protect it with that by which You protect Your righteous servants.'"In another narration, "When one of you goes to his bed, let him take the inner part of his lower garment and dust off his bed with it, and let him mention the name of Allah, for he does not know what may have come upon his bed after he left it. Then when he wishes to lie down, let him lie on his right side and say, 'Glory be to You, Allah, my Lord. By You I lay down my side, and by You I raise it. If You take my soul, forgive it, and if You send it back, protect it with that by which You protect Your righteous servants.'"In another narration, "When one of you comes to his bed, let him dust it off with the edge of his garment three times and say, 'In Your name, my Lord, I lay down my side…'"
قال النبي ﷺ: إذا أوى أحدكم إلى فراشه فلينفض فراشه بداخلة إزاره، فإنه لا يدري ما خلفه عليه، ثم يقول: باسمك ربي وضعت جنبي، وبك أرفعه، إن أمسكت نفسي فارحمها، وإن أرسلتها فاحفظها بما تحفظ به الصالحين. وفي رواية: إذا أوى أحدكم إلى فراشه فليأخذ داخلة إزاره، فلينفض بها فراشه وليسم الله فإنه لا يعلم ما خلفه بعده على فراشه، فإذا أراد أن يضطجع فليضطجع على شقه الأيمن، وليقل: سبحانك اللهم ربي، بك وضعت جنبي، وبك أرفعه، إن أمسكت نفسي فاغفر لها، وإن أرسلتها فاحفظها بما تحفظ به عبادك الصالحين. وفي رواية: إذا جاء أحدكم فراشه فلينفضه بصنفة ثوبه ثلاث مرات وليقل: باسمك ربي وضعت جنبي…
Bukhari narrated it in the Book of Supplications (6320) from Ahmad bin Yunus, Zuhayr told us, Ubaydullah bin Umar told us, Saeed bin Abu Saeed Maqburi told me, from his father, from Abu Hurairah who said, then he mentioned it.Muslim narrated it in the Book of Remembrance and Supplication (2714: 64) from Ishaq bin Musa Ansari, Anas bin Iyad told us, Ubaydullah told us, Saeed bin Abu Saeed Maqburi told me, from his father, from Abu Hurairah, then he mentioned it with the second wording.Bukhari narrated it in the Book of Monotheism (7393) from Abdul-Aziz bin Abdullah, Malik told me, from Saeed bin Abu Saeed Maqburi, from Abu Hurairah, then he mentioned it with the third wording.Muhammad bin Ajlan also narrated it, from Saeed Maqburi, with the same chain, and he added the supplication for waking up, which is the hadith that follows.