The Prophet ﷺ said, "When one of you lies down on his right side and then says, 'O Allah, I have submitted myself to You, turned my face to You, entrusted my back to You, and committed my affair to You. There is no refuge from You except in You. I believe in Your Book and in Your Messenger,' if he dies that night, he will enter Paradise."
أن النبي ﷺ قال: إذا اضطجع أحدكم على جنبه الأيمن ثم قال: اللهم إني أسلمت نفسي إليك، ووجهت وجهي إليك، وألجأت ظهري إليك، وفوضت أمري إليك، لا ملجأ منك إلا إليك، أؤمن بكتابك وبرسولك، فإن مات من ليلته دخل الجنة.
Tirmidhi (3395) and Nasai in Amal al-Yawm wal-Layla (771) both narrated it through various chains from Uthman bin Umar (he is Ibn Faris), who said, "Ali bin Mubarak told us, from Yahya bin Abu Kathir, from Yahya bin Ishaq the nephew of Rafi bin Khadij, from Rafi bin Khadij," and he related it.Tirmidhi said, "This is a hasan gharib hadith from this route, from the hadith of Rafi bin Khadij."I say, it is as he said, for Yahya bin Ishaq, also said to be Ibn Abu Ishaq, narrated this hadith from his uncle Rafi bin Khadij, and no one narrated from him except Yahya bin Abu Kathir. Ibn Main and Ibn Hibban both deemed him trustworthy, and he is hasan al-hadith.As for the wording "and Your messenger," this may be an alteration by the narrator, for this hadith was also narrated by Bara bin Azib, as found in the Sahihayn, where it reads, "I said, let me repeat them, 'and Your messenger whom You sent.' He said, 'No, and Your prophet whom You sent.'" Nevertheless, some routes of Bara's hadith do contain "and Your messenger whom You sent," as in Sahih Muslim as well (2710:56).