Al-Bara' bin 'Azib (May Allah be pleased with them) reported:
Whenever Messenger of Allah (ﷺ) went to bed, he would lie down on his right side and recite: "Allahumma aslamtu nafsi ilaika, wa wajjahtu wajhi ilaika, wa fawwadtu amri ilaika, wa 'alja'tu zahri ilaika, raghbatan wa rahbatan ilaika, la malja'a wa la manja illa ilaika. Amantu bikitabikal-ladhi anzalta, wa nabiyyikal-ladhi arsalta [O Allah! I have submitted myself to You, I have turned my face to You, committed my affairs to You, and depend on You for protection out of desire for You and out of fear of You (expecting Your reward and fearing Your punishment). There is no refuge and no place of safety from You but with You. I believed in the Book You have revealed, and in the Prophet You have sent (i.e., Muhammad (ﷺ)).]"[Al-Bukhari].
App reference: Book 5, Hadith 1
Arabic/English book reference: Book 5, Hadith 814