(34) باب قَوْلِ اللَّهِ تَعَالَى {أَنْزَلَهُ بِعِلْمِهِ وَالْمَلاَئِكَةُيَشْهَدُونَ}
Narrated Al-Bara' bin `Azib:
Allah's Messenger (ﷺ) said, "O so-and-so, whenever you go to your bed (for sleeping) say, 'O Allah! I have surrendered myself over to you and have turned my face towards You, and leave all my affairs to You and depend on You and put my trust in You expecting Your reward and fearing Your punishment. There is neither fleeing from You nor refuge but with You. I believe in the Book (Qur'an) which You have revealed and in Your Prophet (Muhammad) whom You have sent.' If you then die on that night, then you will die as a Muslim, and if you wake alive in the morning then you will receive the reward." (See Hadith No. 323, Vol. 8)
Reference: Sahih al-Bukhari 7488
In-book reference: Book 97, Hadith 114
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 9, Book 93, Hadith 580