Shama-il Tirmidhi Chapter 038, Hadith Number 002 (243).

Hudhayfah Radiyallahu 'Anhu says: "When Rasulullah Sallallahu 'Alayhi Wasallam lay down on a bed, he recited: Allahurmma bi-ith-mika a-mutu wa ahyaa.

Translation...

O Allah! In Thy name do I live and die".

When he awakened he recited this du'aa: Alhamdulillaahil ladhi ahyaanaa ba'da rnaa amaatana wa-ilayhin nushur.

Translation...

'Praise be to Allah Who restored unto us life, having caused us to die and unto Him shall be the Resurrection"'.

Commentary
Sleep is synonymous with death. That is why sleep has been linked to death, and waking with life. For this reason too one should sleep on the right side, as sleeping is an example of death. Because sleep is likened to death, and waking up is becoming alive again. The 'ulama have written, it is a thing that should be pondered upon, that, after dying in this manner on the day of qiyaamah one will be given life again. In reality Allah 'Ta'aala has made this world a little replica of the hereafter. An example of everything has been made in this world so that one may ponder and take heed of things to come. The life in this world is not more than a dream. A person is happy, affluent, possessing all types of luxuries and does not experience any sort of trouble. If this person sees in a dream that he is being taken to jail and flogged, and is experiencing all types of calamities, not realising that it is a dream, he is distressed, and crying too. Suddenly the eyes open and all the tranquillity and happiness returns. The troubles of this dream does not remain nor are its effects felt. In the same manner, this is the state of a pious person. All the difficulties that are experienced in this world, are like a dream. After opening the eyes when all the happiness is experienced, what effect shall the dream have? But imagine the opposite? If one is experiencing luxuries in a dream, then on awakening one finds oneself in jail with all its punishments, what taste shall remain of a sweet dream? If a detainee that is sentenced to hard labour, sees in a dream that he has become king of the worlds, but after awakening finds himself chained in the dark dungeons, of what benefit will this king-manship be to him? The Sahaabah Radiyallahu 'Anhum understood this, they pleasantly endured all hardships, remembering that this life is but like a dream. May the Almighty Allah through His Infinite Mercy also grant us this valuable treasure. His Mercy is widespread.