Abu Hurairah reported,

The Messenger of Allah ﷺ said, "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, mentioning the name of Allah, for he does not know what may have come onto his bed in his absence. Then when he wishes to lie down, let him lie on his right side and say, 'Glory be to You, Allah my Lord. By Your name I lay my side down, and by Your name I raise it up. If You take my soul, forgive it, and if You release it, protect it with that by which You protect Your righteous servants.'"

Azami 13198

Sahih

عن أبي هريرة

أن رسول الله ﷺ قال: إذا آوى أحدكم إلى فراشه، فليأخذ داخلة إزاره، فلينفض بها فراشه، وليسم الله، فإنه لا يعلم ما خلفه بعده على فراشه، فإذا أراد أن يضطجع، فليضطجع على شقه الأيمن، وليقل: سبحانك اللهم ربي بك وضعت جنبي، وبك أرفعه، إن أمسكت نفسي فاغفر لها، وإن أرسلتها فاحفظها بما تحفظ به عبادك الصالحين.

الأعظمي 13198صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Zumar
Section
His saying, "Allah takes the souls at the time of their death and those that do not die during their sleep. Then He keeps those for which He has decreed death and releases the others for a specified term. Indeed in that are signs for a people who give thought."
Numbering
Jami al-Kamil 13198 (2nd edition)
Azami 13198