yaṁ yaṁ vāpi smaran bhāvaṁ
tyajaty ante kalevaram
taṁ tam evaiti kaunteya
yam yam—whatever; vā—either; api—also; smaran—remembering; bhāvam—nature; tyajati—give up; ante—at the end; kalevaram—this body; tam tam—similar; eva—certainly; eti—gets; kaunteya—O son of Kuntī; sadā—always; tat—that; bhāva—state of being; bhāvitaḥ—remembering.
Whatever state of being one remembers when he quits his body, that state he will attain without fail.
The process of changing one's nature at the critical moment of death is here explained. How can one die in the proper state of mind? Mahārāja Bharata thought of a deer at the time of death and so was transferred to that form of life. However, as a deer, Mahārāja Bharata could remember his past activities. Of course the cumulative effect of the thoughts and actions of one's life influences one's thoughts at the moment of death; therefore the actions of this life determine one's future state of being. If one is transcendentally absorbed in Kṛṣṇa's service,then his next body will be transcendental (spiritual), not physical. Therefore the chanting of Hare Kṛṣṇa is the best process for successfully changing one's state of being to transcendental life.
Link to this page: https://prabhupadabooks.com/bg/8/6