Abu Hurairah reported,

The Messenger of Allah ﷺ said, "When one of you rises from his bed and then returns to it, let him dust it off with the edge of his garment three times, for he does not know what may have come onto it after he left. Then when he lies down, 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.' And when he wakes, let him say, 'Praise be to Allah who has restored my body to health, returned my soul to me, and permitted me to remember Him.'"

Tirmidhi 3401

Sahih

حدثنا ابن أبي عمر حدثنا سفيان عن ابن عجلان عن سعيد المقبري

عن أبي هريرة رضي الله عنه

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

الترمذي 3401صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Supplications
Chapter
By Your name, my Lord, I lay down my side
Numbering
Darussalam 3401
Tirmidhi 3401