The Messenger of Allah ﷺ 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 lay my back to rest with 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 have revealed and in Your Prophet whom You have sent.' If you die during that night, you will die upon the natural state of faith."The narrator said, I repeated the words back to memorize them, but I said, "I believe in Your Messenger whom You have sent."He said, "Say, 'I believe in Your Prophet whom You have sent.'"He said, This is a hasan sahih hadith, and it has been narrated through more than one route from al-Bara. We do not know of any narration that mentions ablution except in this hadith.
حدثنا سفيان بن وكيع حدثنا جرير عن منصور عن سعد بن عبيدة ح
أن رسول الله ﷺ قال إذا أخذت مضجعك فتوضأ وضوءك للصلاة ثم اضطجع على شقك الأيمن ثم قل اللهم أسلمت وجهي إليك وفوضت أمري إليك وألجأت ظهري إليك رغبة ورهبة إليك لا ملجأ ولا منجا منك إلا إليك آمنت بكتابك الذي أنزلت ونبيك الذي أرسلت فإن مت في ليلتك مت على الفطرة قال فرددتهن لأستذكره فقلت آمنت برسولك الذي أرسلت فقال قل آمنت بنبيك الذي أرسلت قال وهذا حديث حسن صحيح وقد روي من غير وجه عن البراء ولا نعلم في شيء من الروايات ذكر الوضوء إلا في هذا الحديث
Agreed upon. Muslim narrated it in the Book of Remembrance and Supplication, chapter on supplication before sleep, hadith no. 2710, from the hadith of Jareer. And Bukhari, hadith no. 247, from the hadith of Mansur, similarly. See hadith no. 3394.