When going to bed make an intention of abstention from sin.
Once, a rnan said to Hakeemul Ummat, Hazrat Moulana Thanwi رحمه الله. ” Hazrat, your sleep is also ibadat!”

Hazrat رحمه الله replied: ” Dear friend, that is the status of great people. We are not on that level. When we sleep, we are avoiding sin, hence, we make an intention of abstaining from sin when we sleep.”

Blessed indeed is that sleep which keeps a man away from sin!

It is the perfect wisdom of Allah Ta’ala that he increased the desire for sleep inman during an age when he is most likely to commit sin, and that is the
period of youth. Young people tend to sleep a lot. The ” sleep of the youth” is quite famous. This is indeed a great favour from Allah Ta’ala, for through sleep Allah has saved man from sinning (for the duration of his sleep).