MUHAMMAD s.a.w.w said: (Bukhari :: Book 1 :: Volume 4 :: Hadith 247)
"Whenever you go to bed perform ablution like that for the prayer, lie or your right side and say: 'Allahumma aslamtu wajhi ilaika, wa fauwadtu Amri ilaika wa aljatu zahri ilaika, raghbatan wa rahbatan ilaika, lamalja'a wa la manja mink a ill a ilaika. Amantu bikitabi kalladhi anzalta wa bi nabiyyikal-ladhi arsalta'.
(English: O Allah! I surrender to You and entrust all my affairs to You and depend upon You for Your Blessings both with hope and fear of You. There is no fleeing from You, and there is no place of protection and safety except with You O Allah! I believe in Your Book (the Qur'an) which You have revealed and in Your Prophet (Muhammad) whom You have sent.)
Then if you die on that very night, you will die with faith (i.e. or the religion of Islam). Let the aforesaid words be your last utterance (before sleep) “
This hadith explains the need to do ablution before going to bed along with that dua. If we die the same night, we will die on faith. What can be more lovely then to die as a faithful muslim?
In another hadith, the stae of ablution before sleeping has been described in these words:
[Sahih Bukhari & Sahih Muslim]
The Prophet (SAW) told al-Baraa` bin Aazib (RA) "If you go to your bed, then do your wudoo (ablution) as you would do it for prayer, then lie on your right"
In another hadith, which is classed as “good” by Albaani, the need of ablution has been described in these words:
It is narrated from Ibn e Umar [RA] that the Messenger of Allah (SAW) said, “Purify these bodies, and Allah will purify you. Whenever a slave spends his night in a state of purification, an angel spends his night within his (slave’s) hair and he does not turn over during the night except that he [the angel] says: O Allah, forgive Your slave, for he went to sleep in a state of purification.”
[Reported by Tabarani and graded "good" by Shaikh Al-Albani]
Therefore, the act of ablution before going to bed is sunnah and doing this will not only earn us sawab but also if we die in night while in sleeping, we will die as faithful Muslims and there is nothing better to die as a good Muslim and to enter jannah.