Actions that prevent punishment of the grave
"In general, refraining from what causes punishment in the grave is the best way to avoid being punished. A person must sit for a while before he goes to bed and hold himself accountable for what he gained during that day and what he lost, then renew his sincere repentance to Allah and sleep after having repented, and when he wakes up, be determined not to commit the same sins again. He should do this every night; if he dies that night he would die after having repented, and if he wakes up, he would wake up happy because he was given a respite and given a chance to strive hard in good deeds to make up for what he missed out on. There is nothing better or more beneficial than such a way of going to sleep, especially if he follows this accountability with mentioning Allah and follows the recommendations of Sunnah (Prophetic tradition) on how to go to sleep and supplicate until he falls asleep. The one whom Allah wills good for, He will guide him to doing so." The Prophet sall...