Fiqh-us-Sunnah Volume 1, Purification and Prayer, Fiqh 1.041.
Al-Barra’ ibn ‘Aazib reported that the Messenger of Allah, upon whom be peace, said, “When you go to your bed, perform ablution, lie on your right side and then say, ‘O Allah, I submit my soul to You, and I turn my face to You. I entrust my affairs to You. I retreat unto You for protection with hope and fear in You. There is no resort and no saviour but You. I affirm my faith in Your books which You revealed and in Your prophets you sent.’ If you die during that night, you will be along the natural path. Make it your final statement (of the night). He reported that he repeated this supplication to the Prophet, upon whom be peace, and he said, “…and Your messengers.” The Prophet interjected, “No,…’and the prophets You sent.” (Related by Ahmad, al-Bukhari, and at-Tirmizhi.) This also applies to one who is in post-sex impurity. Ibn ‘Umar asked the Prophet, “O Messenger of Allah, can one of us sleep while he is in post-sex impurity?” The Prophet answered, “Yes, if he makes ablution.” Reported ‘Aishah, “When the Prophet, upon whom be peace, wanted to sleep in a state of post-sex impurity, he would wash his private parts and perform ablution.” (Related by “the group.”)