Supplication when sleeping and waking up
Hudhaifah (radi Allahu anhu) said, Whenever the Prophet (sal Allahu alaihi wa sallam) lay down for sleep at night, he would place his (right) hand under his (right) cheek and supplicate: “Bismika Allahumma amutu wa ahya [O Allah, with Your Name will I die and live (wake up)].” And when he woke up, he would supplicate: “Al-hamdu lillahil-ladhi ahyana ba’da ma amatana, wa ilaihin-nushur (All praise is due to Allah, Who has brought us back to life after He has caused us to die, and to Him is the return).”
We benefit from this Hadith that to recite these supplications prior to going to sleep and on getting up was the practice of the Messenger of Allah (sal Allahu alaihi wa sallam).
In this supplication of the Messenger of Allah (sal Allahu alaihi wa sallam) the state of sleep is associated with death, while the state of being awake is associated with life.
Furthermore, it conjures up the vision of the Day of Judgement.
And Allah knows best!