Praise be to Allah, and peace and blessings be upon the Messenger of Allah. To proceed:
Death, the grave, and the Day of Resurrection are among the greatest stages of the Hereafter. They contain terrors that frighten a person, but for the believer who has prepared for them through faith and righteous deeds, these stages become places of safety and glad tidings.
At the time of death, if a person is righteous, he is given glad tidings of Allah’s pleasure and honor, and he loves to meet Allah, as the Prophet ﷺ said:
“Whoever loves to meet Allah, Allah loves to meet him.”
Narrated by Al-Bukhari and Muslim.
In the grave, the believer experiences the effect of his righteous deeds. His grave is made spacious for him, a door to Paradise is opened for him, and he receives some of its fragrance and comfort. His righteous deeds bring him glad tidings of what pleases him.
Then, when the Hour is established, the believers will not be overtaken by the Greatest Terror. Rather, the angels will receive them with glad tidings. Allah تعالى says:
﴿The greatest terror will not grieve them, and the angels will receive them: “This is your Day which you were promised.”﴾
[Al-Anbiya: 103].
The common reason behind all of this is faith in Allah and righteous deeds. Allah تعالى says:
﴿Those whose lives the angels take while they are in a good state, saying: “Peace be upon you. Enter Paradise because of what you used to do.”﴾
[An-Nahl: 32].
Thus, to the extent that a Muslim fulfills faith, piety, and righteous deeds, he will have a corresponding share of security, reassurance, and glad tidings at death, in the grave, and on the Day of Resurrection.
Therefore, the believer should prepare for these stages by hastening to acts of obedience, consistently performing righteous deeds, and increasing in goodness, so that he may meet Allah تعالى while hoping for His mercy and pleasure.
And Allah تعالى knows best.