What is to be said upon going to sleep
Hudhayfah (may Allah be pleased with him) reported: “Whenever the Messenger of Allah, peace and blessings be upon him, was about to lie down to sleep he would say, ‘In Your name, O Allah, I die and I live.’ And when he awoke he would say, ‘Praise be to Allah who revived us after He caused us to die, and to Him is the return.’” Agreed upon.
ʿĀʾishah (may Allah be pleased with her) said: “When the Prophet, peace and blessings be upon him, retired to his bed every night, he would cup his hands, blow lightly into them, and recite into them Sūrat al-Ikhlāṣ (‘Say: He is Allah, the One’), Sūrat al-Falaq (‘Say: I seek refuge in the Lord of daybreak’), and Sūrat al-Nās (‘Say: I seek refuge in the Lord of mankind’). He would then wipe with his hands whatever he could of his body, starting with his head, his face, and the front of his body, doing that three times.” Agreed upon.
Abū Hurayrah (may Allah be pleased with him) narrated: “Someone used to come and scoop up from the charity—Abū Hurayrah had been put in charge of it by the Prophet, peace and blessings be upon him—night after night. When the third night arrived, Abū Hurayrah said, ‘I will certainly take you to the Messenger of Allah, peace and blessings be upon him.’ The man replied, ‘Let me go, and I will teach you some words by which Allah will benefit you’—and they were extremely keen on anything good. He said, ‘When you lie down in your bed, recite the Throne Verse (āyat al-kursī): “Allah—there is no deity but Him, the Ever-Living, the Sustainer” (Qur’an 2:255) until you complete it, for a guardian from Allah will remain over you and no devil will approach you until morning.’ The Prophet, peace and blessings be upon him, said, ‘He told you the truth, though he is a persistent liar—that was a devil.’” Reported by al-Bukhārī.