Al-Adab Al-Mufrad, Book 50, Hadith 1210 (English) ⓘ
Abu Hurayra said, "The Messenger of Allah, may Allah bless him and grant him peace, said, 'When one of you goes to bed, he should undo the inside of his lower garment and dust the bed with it. He does not know what has come on his bed since he left it. He should lie down on his right side and say, 'In Your Name I have laid down on my side. If You take my soul, then have mercy on it. If You release it, then preserve it in the manner in which You preserve the men of right action."
حَدَّثَنَا مُحَمَّدُ بْنُ سَلاَمٍ، قَالَ: أَخْبَرَنَا عَبْدَةُ، عَنْ عُبَيْدِ اللهِ، عَنْ سَعِيدِ بْنِ أَبِي سَعِيدٍ الْمَقْبُرِيِّ، عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ قَالَ: قَالَ رَسُولُ اللهِ صلى الله عليه وسلم: إِذَا أَوَى أَحَدُكُمْ إِلَى فِرَاشِهِ، فَلْيَحِلَّ دَاخِلَةَ إِزَارِهِ، فَلْيَنْفُضْ بِهَا فِرَاشَهُ، فَإِنَّهُ لاَ يَدْرِي مَا خَلَّفَ فِي فِرَاشِهِ، وَلْيَضْطَجِعْ عَلَى شِقِّهِ الأَيْمَنِ، وَلْيَقُلْ: بِاسْمِكَ وَضَعْتُ جَنْبِي، فَإِنِ احْتَبَسَتْ نَفْسِي فَارْحَمْهَا، وَإِنْ أَرْسَلْتَهَا فَاحْفَظْهَا بِمَا تَحْفَظُ بِهِ الصَّالِحِينَ، أَوْ قَالَ: عِبَادَكَ الصَّالِحِينَ.
also referenced under: Hadith 1210 (Reference) & Book 50, Hadith 1210 (In-Book)