The Messenger of Allah (May peace be upon him) said to me: When you go to your bed, perform ablution like the ablution for prayer, and then lie on your right side and say: O Allah I have handed over my face to thee, entrusted my affairs to thee, and committed my back to thee out of desire for and fear to thee. There is no refuge and no place of safety from thee except by having recource to thee. I believe in Thy Book which Thou hast sent down and in Thy prophet whom thou hast sent down. He said : If you die (that night), you would die in the true religion, and utter these words in the last of that you utter (other prayers). Al-Bara said : I said: I memorise them, and then I repeated, saying “and in Thy Apostle whom Thou hast sent”. He said : No, say : “and in Thy Prophet whom Thou hast sent. (Using translation from Abū Dāʾūd 5046)
قَالَ رَسُولُ اللهِ ﷺ إِذَا أَتَيْتَ مَضْجَعَكَ فَتَوَضَّأْ وُضُوءَكَ لِلصَّلَاةِ ثُمَّ لِيَكُنْ آخِرَ مَا تَقُولُ اللهُمَّ أَسْلَمْتُ وَجْهِي إِلَيْكَ وَفَوَّضْتُ أَمْرِي إِلَيْكَ وَأَلْجَأْتُ ظَهْرِي إِلَيْكَ رَهْبَةً وَرَغْبَةً إِلَيْكَ لَا مَلْجَأَ وَلَا مَنْجَى مِنْكَ إِلَّا إِلَيْكَ آمَنْتُ بِكِتَابِكَ الَّذِي أَنْزَلْتَ وَبِنَبِيِّكَ الَّذِي أَرْسَلْتَ فَإِنْ مُتَّ مُتَّ عَلَى الْفِطْرَةِ