Hudhayfah reports: ‘When the Prophet wanted to sleep, he would say: “It is in Your name, my Lord, that I die and live”. When he woke up from sleep, he would say: “Praise be to God Who has given us life after he has caused us to die, and to Him we all return.” (Bukhari, Ibn Majah)
We note here that the Prophet (peace be upon him) compares sleep to death and waking up to coming back to life. This is a point the Prophet stressed many times. It is indeed accurate, because when we go to sleep, we lose consciousness of everything around us, in the same way a dead person is unconscious of what goes on next to him. Waking up is a return to activity and full control of one’s senses.
This comparison is also stated in the Quran, when God says that He gathers people’s souls when they die, but those who are not dead, He gathers their souls when they sleep. He then keeps with Him those who died and releases the others for a specified time. (39: 42) To acknowledge this is to acknowledge God’s control of our lives and that death is as near to us as the next time we go to sleep.