The Lord says in Bhagavad-gītā (8.5):
smaran muktvā kalevaram
yaḥ prayāti sa mad-bhāvaṁ
yāti nāsty atra saṁśayaḥ
“Whoever, at the time of death, quits his body remembering Me alone, at once attains My nature. Of this there is no doubt.” Of course, one must practice before one is overcome by death, but the perfect yogī, namely the devotee, dies in trance, thinking of Kṛṣṇa. He does not feel his material body being separated from his soul; the soul is immediately transferred to the spiritual world. Tyaktvā dehaṁ punar janma naiti mām eti: the soul does not enter the womb of a material mother again, but is transferred back home, back to Godhead. This yoga, bhakti-yoga, is the highest yoga system, as explained by the Lord Himself in Bhagavad-gītā (6.47):
mad-gatenāntarātmanā
śraddhāvān bhajate yo māṁ
sa me yuktatamo mataḥ
“Of all yogīs, he who always abides in Me with great faith, worshiping Me in transcendental loving service, is most intimately united with Me in yoga and is the highest of all.” The bhakti-yogī always thinks of Kṛṣṇa, and therefore at the time of death he can very easily transfer himself to Kṛṣṇaloka, without even perceiving the pains of death.
Srimad Bhagavatam 6.10.22 purport