Srimad-Bhagavatam: Canto 4 - Chapter 1 - Verse 13


एवं स वीरप्रवर: संयोज्यात्मानमात्मनि ।ब्रह्मभूतो द‍ृढं काले तत्याज स्वं कलेवरम् ॥ १३ ॥


evaṁ sa vīra-pravaraḥsaṁyojyātmānam ātmanibrahma-bhūto dṛḍhaṁ kāletatyāja svaṁ kalevaram


In due course of time, when Pṛthu Mahārāja was to give up his body, he fixed his mind firmly upon the lotus feet of Kṛṣṇa, and thus, completely situated on the brahma-bhūta platform, he gave up the material body.


According to a Bengali proverb, whatever spiritual progress one makes in life will be tested at the time of death. In Bhagavad-gītā (8.6) it is also confirmed: yaṁ yaṁ vāpi smaran bhāvaṁ tyajaty ante kalevaram/ taṁ tam evaiti kaunteya sadā tad-bhāva-bhāvitaḥ. Those who are practicing Kṛṣṇa consciousness know that their examination will be held at the time of death. If one can remember Kṛṣṇa at death, he is immediately transferred to Goloka Vṛndāvana, or Kṛṣṇaloka, and thus his life becomes successful. Pṛthu Mahārāja, by the grace of Kṛṣṇa, could understand that the end of his life was near, and thus he became very jubilant and proceeded to completely give up his body on the brahma-bhūta stage by practicing the yogic process. It is thoroughly described in the following verses how one can voluntarily give up this body and return home, back to Godhead. The yogic process practiced by Pṛthu Mahārāja at the time of death accelerates the giving up of this body while one is in sound health physically and mentally. Every devotee desires to give up the body while it is sound physically and mentally. This desire was also expressed by King Kulaśekhara in his Mukunda-mālā-stotra: King Kulaśekhara wanted to give up his body while in a healthy state, and he thus prayed to Kṛṣṇa to let him die immediately while he was in good health and while his mind was sound. When a man dies, he is generally overpowered by mucus and bile, and thus he chokes. Since it is very difficult to vibrate any sound while choking, it is simply by Kṛṣṇa’s grace that one can chant Hare Kṛṣṇa at the time of death. However, by situating oneself in the muktāsana position, a yogī can immediately give up his body and go to whatever planet he desires. A perfect yogī can give up his body whenever he desires through the practice of yoga.