The Messenger of Allah ﷺ said, "When one of you goes to his bed, let him dust off his bedding with the inner edge of his lower garment, for he does not know what may have come onto it after he left. Then let him lie down on his right side and say, 'In Your name, my Lord, I lay my side down, and by You I raise it up. If You take my soul, have mercy on it, and if You send it back, protect it with that by which You protect Your righteous servants.'"Suhayl reported from his father, from Abu Hurairah, that the Prophet ﷺ used to say when he went to his bed, "Allah, Lord of the heavens, Lord of the earth, Lord of everything, Splitter of the grain and the date stone, Revealer of the Torah, the Gospel, and the Quran, I seek refuge in You from the evil of every evil thing whose forelock You hold. You are the First, so there is nothing before You. You are the Last, so there is nothing after You. You are the Manifest, so there is nothing above You. You are the Hidden, so there is nothing beyond You."Wahb added in his version, "Settle my debt for me and free me from poverty."
حدثنا موسى بن إسمعيل حدثنا وهيب ح و حدثنا وهب بن بقية عن خالد نحوه عن سهيل عن أبيه عن أبي هريرة عن النبي ﷺ أنه كان يقول إذا أوى إلى فراشه اللهم رب السموات ورب الأرض ورب كل شيء فالق الحب والنوى منزل التوراة والإنجيل والقرآن أعوذ بك من شر كل ذي شر أنت آخذ بناصيته أنت الأول فليس قبلك شيء وأنت الآخر فليس بعدك شيء وأنت الظاهر فليس فوقك شيء وأنت الباطن فليس دونك شيء زاد وهب في حديثه اقض عني الدين وأغنني من الفقر
Muslim narrated it in the Book of Remembrance and Supplication, in the chapter on supplication before sleep, hadith no. 2713, from the hadith of Khalid.