Bara bin Azib reported,

The Prophet ﷺ said to him, "Shall I teach you words to say when you go to your bed? If you die that night, you will die upon the natural disposition of Islam, and if you wake in the morning, you will wake having earned good. Say, 'O Allah, I have submitted myself to You, turned my face to You, entrusted my affair to You, and laid my back against You, in hope of You and in fear of You. There is no refuge or escape from You except to You. I have believed in Your Book which You sent down and Your Prophet whom You sent.'"Bara said, "I said, 'And in Your Messenger whom You sent.'"He struck my chest with his hand and said, "And Your Prophet whom You sent."

Tirmidhi 3394

Sahih

حدثنا ابن أبي عمر حدثنا سفيان بن عيينة عن أبي إسحق الهمداني

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

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

الترمذي 3394صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Supplications
Chapter
Supplication when retiring to bed
Numbering
Darussalam 3394
Tirmidhi 3394