Messenger of Allah ﷺ 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) (Using translation from Bukhārī 7488)
قَالَ رَسُولُ اللهِ ﷺ إِذَا أَوَيْتَ إِلَى فِرَاشِكَ فَقُلْ اللهُمَّ أَسْلَمْتُ نَفْسِي إِلَيْكَ وَوَجَّهْتُ وَجْهِي إِلَيْكَ وَفَوَّضْتُ أَمْرِي إِلَيْكَ وَأَلْجَأْتُ ظَهْرِي إِلَيْكَ رَغْبَةً وَرَهْبَةً إِلَيْكَ لَا مَلْجَأَ وَلَا مَنْجَا إِلَّا إِلَيْكَ آمَنْتُ بِكِتَابِكَ الَّذِي أَنْزَلْتَ وَبِنَبِيِّكَ الَّذِي أَرْسَلْتَ فَإِنْ مِتَّ مِنْ لَيْلَتِكَ مِتَّ وَأَنْتَ عَلَى الْفِطْرَةِ وَإِنْ أَصْبَحْتَ أَصَبْتَ خَيْرًا