Sahih al-Bukhari 7488: Etiquette of Sleeping and Waking
Hazrat Bara bin Azib (ra) relates that the Messenger of Allah (saw) said: “My good man! When you come to your bed to rest, make this prayer: ‘O my Allah! I have committed my soul to You, I have turned my face towards You, I have entrusted everything of mine to You. You alone are my support. I am drawn towards You and I fear You. There is no place of refuge and no place of safety except You. I have believed in this Book of Yours which You have sent down, and I have accepted this Prophet of Yours whom You have sent.’” After teaching this prayer the Holy Prophet (saw) said: “If you sleep after reciting this prayer and die that same night, you will die upon sound nature (Fitrah), and if you rise alive in the morning, virtue and good will be your lot.” There is also a narration that the Holy Prophet (saw) said: “When you are about to lie down on your bed, first perform ablution (Wudu) as ablution is performed for the Prayer, then lie down on your right side and then recite this prayer. Let this be the very last thing; no conversation should take place after it.”
AI-translated by Islam-Today