Bara bin Azib reported,

The Prophet ﷺ said, "When you go to your bed, perform ablution as you would for prayer, then lie down on your right side and say, 'O Allah, I submit my face to You, entrust my affair to You, and rely with my back upon You, in hope of You and in fear of You. There is no refuge nor escape from You except to You. O Allah, I believe in Your Book which You have revealed and in Your Prophet whom You have sent.' If you die that night, you will die upon the natural disposition of faith. Make these words the last thing you utter."The narrator said, "I repeated them back to the Prophet ﷺ, and when I reached, 'O Allah, I believe in Your Book which You have revealed,' I said, 'and Your Messenger.'"The Prophet ﷺ said, "No. Say, 'and Your Prophet whom You have sent.'"

Bukhari 247

Sahih

حدثنا محمد بن مقاتل قال أخبرنا عبد الله قال أخبرنا سفيان عن منصور عن سعد بن عبيدة

عن البراء بن عازب قال

قال النبي ﷺ إذا أتيت مضجعك فتوضأ وضوءك للصلاة ثم اضطجع على شقك الأيمن ثم قل اللهم أسلمت وجهي إليك وفوضت أمري إليك وألجأت ظهري إليك رغبة ورهبة إليك لا ملجأ ولا منجا منك إلا إليك اللهم آمنت بكتابك الذي أنزلت وبنبيك الذي أرسلت فإن مت من ليلتك فأنت على الفطرة واجعلهن آخر ما تتكلم به قال فرددتها على النبي ﷺ فلما بلغت اللهم آمنت بكتابك الذي أنزلت قلت ورسولك قال لا ونبيك الذي أرسلت

البخاري 247صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Wudu
Chapter
Virtue of sleeping in a state of wudu
Numbering
Darussalam 247
Bukhari 247