Of the invocation which the Messenger of Allah (peace be upon him) used to say upon going to sleep is the Hadith that was reported by Imam Muslim in his Sahih on the authority of Anas ibn Malik (may Allah be pleased with him) that when the Messenger of Allah (peace be upon him) went to bed, he used to say: "Al Hamdu lillah-illadhi at`amana wa saqana, wa kafana wa awana, fakam mimman la kafiya lahu wa la mu'wiya (Praise is due to Allah Who has fed us, provided us drink, satisfied us and gave us protection. Many are those who have no one to provide for them, or give them shelter).'' [Reported by Muslim No. 2715].
In this invocation a Muslim recalls his past days and times, food and drink, sufficiency, and abode, whereas some people cannot find food to nourish them, drink to water them, clothes to cover their private parts, or a home to seek shelter in. Moreover, some of them died in destructive famines and calamitous famine, so whomever Allah has honored by giving them food, drink, and home should feel the great favor of Allah (Glory be to Him) by providing him with food, drink, sufficiency, and home. Let it be known that showing gratitude to Allah for His Blessings will make these favors and bounties continuous. Allah (may He be Glorified and Exalted) says: "And (remember) when your Lord proclaimed: "If you give thanks (by accepting Faith and worshipping none but Allâh), I will give you more (of My Blessings); but if you are thankless (i.e. disbelievers), verily My Punishment is indeed severe."" [Surat Ibrahim: 7].
Showing gratitude always brings about continuous blessings and favors, therefore it was said: "If you do not see that your conditions are not getting better, resort to thanking and showing gratitude."
As for his saying: "Praise is due to Allah Who has fed us, provided us drink," it contains gratitude and thanking Allah (may He be Glorified and Exalted) for His Favors, Blessings, His Wide Benevolence, and Generosity because He (Glory be to Him) is the most entitled to be praised and thanked.
As for his saying: "Satisfied us," it means warding off harms and protecting us against evil things and animals. It was said: The meaning is: protected us and fulfilled our needs. There is no objection that both meanings are intended because both are included in the meaning of sufficiency.
As for his saying: "And gives protection," it means: Provided us shelter, granted us home to live in, and made us return home to have some rest, and did not make us wander aimlessly like animals without home or abode. Allah (may He be Exalted) says: "And Allâh has made for you in your homes an abode" [Surat An-Nahl: 80]. The meaning is to live therein, protect you against heat and cold, screen you from the eyes of people, and to gather therein with those whom you provide living for. Furthermore, homes contain more benefits than ever a person thinks, so praise be to Allah who grants us many favors. To Him belongs an abundant, beautiful, and blessed praise as Allah loves and desires.