A human being’s salvation depends on his state at the time of death. He will enjoy eternal comfort, should he be blessed with the gift of ḥusn al-khātimah, otherwise he will taste boundless punishment.
Ḥāḍrat ʿUbādah Ibn Ṣāmit رضي الله عنه narrated from the Prophet ﷺ, “He who loves to meet Allāh, Allāh loves to meet him; and he who dislikes to meet Allāh, Allāh dislikes to meet him.”
When Ḥāḍrat ʿĀishah رضي الله عنها heard this, she asked the Prophet ﷺ, “We will be able to meet Allāh only after death, but we do not like death.” The Prophet ﷺ replied, “That is not the case. The truth of the matter is that when death approaches a believer, the angels give him the cheerful news of Paradise and Allāh’s pleasure. This news makes death dearer to him. Likewise, when death approaches an unbeliever, the torment and punishment is presented to him. This situation makes the death a hateful and reprehensible thing to him.” [Bukhārī and Muslim – Maẓharī]
In short, the love and hatred for death of the present time is not counted. What counts is [the love of] death, or [the love of] meeting Allāh at the time of the extraction of soul [from the physical body] and [the love of] Allāh’s pleasure. [Maʿāriful Qur’ān, Volume 8, Page 789-790]
Ḥāḍrat ʿUmar رضي الله عنه said, حاسبوا أنفسكم قبل أن تحاسبوا، وزنوا أعمالكم قبل أن توزن عليكم، وتزينوا للعرض الأكبر “Take account of yourselves before it is taken of you. Weigh your deeds before they are weighed for you (i.e on the Day of Judgement) and beautify yourselves for the great display (on the Day of Judgement).”