Narrated Al-Bara bin `Azib
Allah's Messenger (ﷺ) said to me, "When you want to go to bed, perform ablution as you do for prayer, then lie down on your right side and say: 'Allahumma aslamtu wajhi ilaika, wa fawwadtu 'amri ilaika wa alja'tu dhahri ilaika, raghbatan wa rahbatan ilaika, la malja'a wa la manja minka illa ilaika. Amantu bikitabik al-ladhi anzalta wa binabiyyika al-ladhi arsalta'. If you should die then (after reciting this) you will die on the religion of Islam (i.e., as a Muslim); so let these words be the last you say (before going to bed)" While I was memorizing it, I said, "Wa birasulika al-ladhi arsalta (in Your Apostle whom You have sent).' The Prophet (ﷺ) said, "No, but say: Wa binabiyyika al-ladhi arsalta (in Your Prophet whom You have sent).