Bara bin Azib reported,

The Messenger of Allah ﷺ said, "So-and-so, when you go to your bed, say, 'O Allah, I have submitted myself to You, turned my face toward You, entrusted my affair to You, and placed my back under Your protection, in hope of You and in fear of You. There is no refuge or escape from You except to You. I believe in Your Book which You have revealed and in Your Prophet whom You have sent.' If you die during that night, you will die upon the natural faith, and if you wake in the morning, you will have earned a reward."

Bukhari 7488

Sahih

حدثنا مسدد حدثنا أبو الأحوص حدثنا أبو إسحاق الهمداني

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

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

البخاري 7488صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tawhid
Chapter
Allah's saying, "He sent it down with His knowledge, and the angels testify"
Numbering
Darussalam 7488
Bukhari 7488