Arjun wanted to know how, at the time of death, you (Krishna) are to be known by the self-disciplined (8.2) and Krishna replies, "He enters My Being who thinks of Me alone at the hour of the body being abandoned. This truth is beyond doubt" (8.5).
This is a definitive assurance that one attains HIM even if one remembers him at the time of death. But this verse gives an impression that throughout life one can perpetrate evil, be a misguided fool who follows the path of demons, be a hypocrite or deluded, can chase pleasures and desires; and it would be sufficient to remember 𝙥𝙖𝙧𝙖𝙢𝙖𝙩𝙢𝙖 at the end. Krishna immediately dispels this notion and says "Of whatever being one thinks at the end while leaving the body, to that alone one goes, (because) of long persistence in it (during lifetime)" (8.6).
Firstly, neither do we know about the time of death nor can anyone give a guarantee. The time of death is so uncertain that any plan of remembering 𝙥𝙖𝙧𝙖𝙢𝙖𝙩𝙢𝙖 based on that is likely to fail. Secondly, the general tendency is to resist change. Transitioning from an evil way of living to the yogi way of living is a big leap which requires time and effort. It simply can't happen at the moment of death. Attachments to possessions and people won't go in one instance. Thirdly, when one approaches old age one is likely to be dominated by confusion than clarity and waiting till the end doesn't help.
The implication is that one should start the journey towards 𝙥𝙖𝙧𝙖𝙢𝙖𝙩𝙢𝙖 early in life without waiting for the uncertain end. It's like having a work-life balance at every stage of life instead of working hard today with a retirement plan to relax at a later stage.