When you go to bed, perform ablution as is done for prayer; then lie down pn the right side and recite:" O Allah, I turn my face towards Thee and entrust my affair to Thee. I retreat unto Thee for protection with hope in Thee and fear of Thee. There is no resort and no deliverer (from hardship) but Thou only. I affirm my faith in Thine books which Thou revealed and in Thine Apostles whom Thou sent." Make this as the last word of yours (when you go to sleep) and in case you die during that night, you would die upon Fitra (upon Islam). And as I repeated these words in order to commit them to memory, I said:" I affirm my faith in Thy Messenger (Rasul) whom Thou sent." He said: Say:" I affirm my faith in the Apostle (Nabi) whom Thou sent."
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِذَا أَخَذْتَ مَضْجَعَكَ فَتَوَضَّأْ وُضُوءَكَ لِلصَّلاَةِ ثُمَّ اضْطَجِعْ عَلَى شِقِّكَ الأَيْمَنِ ثُمَّ قُلِ اللَّهُمَّ إِنِّي أَسْلَمْتُ وَجْهِي إِلَيْكَ وَفَوَّضْتُ أَمْرِي إِلَيْكَ وَأَلْجَأْتُ ظَهْرِي إِلَيْكَ رَغْبَةً وَرَهْبَةً إِلَيْكَ لاَ مَلْجَأَ وَلاَ مَنْجَا مِنْكَ إِلاَّ إِلَيْكَ آمَنْتُ بِكِتَابِكَ الَّذِي أَنْزَلْتَ وَبِنَبِيِّكَ الَّذِي أَرْسَلْتَ وَاجْعَلْهُنَّ مِنْ آخِرِ كَلاَمِكَ فَإِنْ مُتَّ مِنْ لَيْلَتِكَ مُتَّ وَأَنْتَ عَلَى الْفِطْرَةِ قَالَ فَرَدَّدْتُهُنَّ لأَسْتَذْكِرَهُنَّ فَقُلْتُ آمَنْتُ بِرَسُولِكَ الَّذِي أَرْسَلْتَ قَالَ قُلْ آمَنْتُ بِنَبِيِّكَ الَّذِي أَرْسَلْتَ