Bara bin Azib reported,

The Messenger of Allah ﷺ instructed a man that when he lay down in his bed at night, he should say, "O Allah, I have submitted myself to You, turned my face to You, entrusted my back to You, and committed my affair to You, 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 revealed and in Your Messenger whom You sent."If he dies, he dies upon the natural disposition.Ibn Bashshar did not mention "at night" in his version of the hadith.

Muslim 6884

Sahih

حدثنا محمد بن المثنى حدثنا أبو داود حدثنا شعبة ح و حدثنا ابن بشار حدثنا عبد الرحمن وأبو داود قالا حدثنا شعبة عن عمرو بن مرة قال سمعت سعد بن عبيدة

يحدث عن البراء بن عازب

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

مسلم 6884صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Remembrance, supplication, Tawba, and seeking forgiveness
Chapter
What to say when sleeping and lying down
Numbering
Darussalam 6884
Muslim 6884