From The Most Beneficial Ways To Be Saved From The Punishment Of The Grave
Ibn al Qayyim (Allaah have mercy upon him) said:
“From the most beneficial ways to be saved from the punishment of the grave, is that a person sits for the sake of Allaah for an hour when he intends to sleep, bringing oneself to account from what he has lost (from sins & not doing good deeds) and gained (from good deeds) in his day. Then he repents a new sincere repentance between him and Allaah and he sleeps upon this state of repentance, and he sleeps in this state determined never to return back to that sin if he was to wake up. And he does this every night, if he dies that night he dies upon Tawbah (true&sincere repentance) and if he wakes up he wakes up focused on doing good deeds, delighted that Allaah has delayed his appointed time of death and he asks Allaah to pardon him for his shortcomings and rectifies anything he missed out on from the previous day (from good deeds).
There is nothing more beneficial to the servant (of Allaah) than this type of repentance especially if he follows this with the remembrance of Allaah and implementation of the remembrances which are found in the Sunnah of Allaah’s Messenger صلى الله عليه وسلم before going to sleep. Whoever Allaah wants good for, He gives them the success (enlightenment) to do this.”
[Mentioned by our beloved teacher Hassan Somali حفظه الله ورعاه in Sharhus-Sunnah al Barbaharee lesson, chapter on the Punishment of the grave]