Sahih Muslim 2715
Sahih Muslim · Book 48: The Book Pertaining to the Remembrance of Allah, Supplication, Repentance and Seeking Forgiveness · Supplication When Going To Sleep
Anas reported Allah's Messenger (ﷺ) as saying:
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ ، حَدَّثَنَا يَزِيدُ بْنُ هَارُونَ ، عَنْ حَمَّادِ بْنِ سَلَمَةَ ، عَنْ ثَابِتٍ ، عَنْ أَنَسٍ ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ إِذَا أَوَى إِلَى فِرَاشِهِ قَالَ " الْحَمْدُ لِلَّهِ الَّذِي أَطْعَمَنَا وَسَقَانَا وَكَفَانَا وَآوَانَا فَكَمْ مِمَّنْ لاَ كَافِيَ لَهُ وَلاَ مُئْوِيَ " .
When you go to bed, say:" Praise is due to Allah Who fed us, provided us drink, sufficed us and provided us with shelter, for many a people there is none to suffice and none to provide shelter."