When Allah's Messenger (ﷺ) went to bed, he used to sleep on his right side and then say, "All-ahumma aslamtu nafsi ilaika, wa wajjahtu wajhi ilaika, wa fauwadtu `Amri ilaika, wa alja'tu zahri ilaika, raghbatan wa rahbatan ilaika. La Malja'a wa la manja minka illa ilaika. Amantu bikitabika al-ladhi anzalta wa nabiyyika al-ladhi arsalta! Allah's Messenger (ﷺ) said, "Whoever recites these words (before going to bed) and dies the same night, he will die on the Islamic religion (as a Muslim).
Reference: Sahih al-Bukhari 6315 In-book : Book 80, Hadith 12 USC-MSA web (English) : Vol. 8, Book 75, Hadith 327 (deprecated)
Help us gift a modern, ad-free Islamic application for the Muslim Ummah. Your donation will be recorded as Sadaqah Jariyah in your book of deeds, In Sha Allah.