One should pray to the Lord to be able to chant His holy name at the time of death:
[The priests at King Nabhi’s sacrifice to Lord Visnu]: Dear Lord, we may not be able to remember Your name, form and qualities, due to stumbling, hunger, falling down, yawning or being in a miserable diseased condition at the time of death when there is a high fever. We therefore pray unto You, O Lord, for You are very affectionate to Your devotees. Please help us remember You and utter Your holy names, attributes and activities, which can dispel all the reactions of our sinful lives.
The real success in life is ante narayana−smrtih−remembering the holy name, attributes, activities and form of the Lord at the time of death. Although we may be engaged in the Lord's devotional service in the temple, material conditions are so tough and inevitable that we may forget the Lord at the time of death due to a diseased condition or mental derangement. Therefore we should pray to the Lord to be able to remember His lotus feet without fail at the time of death, when we are in such a precarious condition.
– Srimad Bhagavatam 5.3.12
If one has chanted loudly and distinctly during his life, it is quite possible that even at the time of death he will be able to chant with faith and love:
[Sukadeva Gosvami to King Pariksit]: While suffering at the time of death, Ajamila chanted the holy name of the Lord, and although the chanting was directed toward his son, he nevertheless returned back to home, back to Godhead. Therefore if one faithfully and inoffensively chants the holy name of the Lord, where is the doubt that he will return to Godhead?
While the body is fit, [one should] chant the holy name of the Lord loudly and distinctly. If one does so, it is quite possible that even at the time of death he will be properly able to chant the holy name of the Lord with love and faith.
– Srimad Bhagavatam 6.2.49
Those who are strong in Krsna consciousness by always chanting the Hare Krsna mantra can remember Krsna at the time of death:
If, in our healthy condition, we think of the lotus feet of the Lord and die, it is most fortunate. In old age, at the time of death, the throat sometimes becomes choked with mucus or blocked by air. At such time the sound vibration of Hare Krsna, the maha−mantra, may not come out. Thus one may forget Krsna. Of course, those who are strong in Krsna consciousness cannot possibly forget Krsna at any stage because they are accustomed to chanting the Hare Krsna mantra, especially when there is a signal from death.
– Srimad Bhagavatam 4.28.15
It is by Krsna's grace that one can chant Hare Krsna at the time of death:
According to a Bengali proverb, whatever spiritual progress one makes in life will be tested at the time of death. In Bhagavad−gita (8.6) it is also confirmed:
yam yam vapi smaran bhavam tyajaty ante kalevaram
tam tam evaiti kaunteya sada tad−bhava−bhavitah
Those who are practicing Krsna consciousness know that their examination will be held at the time of death. If one can remember Krsna at death, he is immediately transferred to Goloka Vrndavana, or Krsnaloka, and thus his life becomes successful. Prthu Maharaja, by the grace of Krsna, 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-bhuta 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 Prthu Maharaja 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 Kulasekhara in his Mukunda−mala−stotra:
krsna tvadiya−padapankaja−panjarantam
adyaiva me visatu manasa−raja−hamsah
prana−prayana−samaye kapha−vata−pittaih
kanthavarodhana−vidhau smaranam kutas te
King Kulasekhara wanted to give up his body while in a healthy state, and he thus prayed to Krsna 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 Krsna's grace that one can chant Hare Krsna at the time of death.
– Srimad Bhagavatam 4.23.13
The Lord enables the yogi−devotee to chant His holy name at the time of death and thus go back to Godhead:
[Bhisma to King Yudhisthira]: The Personality of Godhead, who appears in the mind of the devotee by attentive devotion and meditation and by chanting of the holy name, releases the devotee from the bondage of fruitive activities at the time of his quitting the material body.
Such a yogī devotee of the Lord engages himself twenty-four hours daily in the service of the Lord so that his whole attention is engrossed with the thoughts of the Lord in ninefold devotional service, namely hearing, chanting, remembering, worshiping, praying, becoming a voluntary servant, carrying out orders, establishing a friendly relationship, or offering all that one may possess, in the service of the Lord. By such practice of yoga, or linking up in the service of the Lord, one is recognized by the Lord Himself, as it is explained in the Bhagavad-gītā concerning the highest perfectional stage of samādhi.The Lord calls such a rare devotee the best amongst all the yogis. Such a perfect yogi is enabled by the divine grace of the Lord to concentrate his mind upon the Lord with a perfect sense of consciousness, and thus by chanting His holy name before quitting the body the yogi is at once transferred by the internal energy of the Lord to one of the eternal planets where there is no question of material life and its concomitant factors.
– Srimad Bhagavatam 1.9.23
By chanting the holy name, one becomes fearless at the time of death:
[The] principles of vaidhi bhakti are also described in Srimad−Bhagavatam, Second Canto, First Chapter, verse 35, where Sukadeva Gosvami instructs the dying Maharaja Pariksit as to his course of action. Maharaja Pariksit met Sukadeva Gosvami just a week before his death, and the King was perplexed as to what should be done before he was to pass on. Many other sages also arrived there, but no one could give him the proper direction. Sukadeva Gosvami, however, gave this direction to him as follows: "My dear King, if you want to be fearless in meeting your death next week (for actually everyone is afraid at the point of death), then you must immediately begin the process of hearing and chanting and remembering God."
– The Nectar of Devotion
By chanting the holy name at the time of death, one enters the spiritual sky:
[The sages to Dhruva Maharaja]: Dear Dhruva, O son of King Uttānapāda, may the Supreme Personality of Godhead known as Śārńgadhanvā, who relieves the distresses of His devotees, kill all your threatening enemies. The holy name of the Lord is as powerful as the Lord Himself. Therefore, simply by chanting and hearing the holy name of the Lord, many men can be fully protected from fierce death without difficulty. Thus a devotee is saved.
By the grace of the Lord, if a devotee, at the time of death, can simply chant His holy name
Hare Krsna Hare Krsna Krsna Krsna Hare Hare
Hare Rama Hare Rama Rama Rama Hare Hare
simply by chanting this maha−mantra, he immediately surpasses the great ocean of the material sky and enters the spiritual sky. He never has to come back for repetition of birth and death. Simply by chanting the holy name of the Lord, one can surpass the ocean of death.
– Srimad Bhagavatam 4.10.30
One who chants the holy name upon accidental death is saved from hellish life after death:
[The Visnudutas to the Yamadutas]: If one chants the holy name of Hari and then dies because of an accidental misfortune, such as falling from the top of a house, slipping and suffering broken bones while traveling on the road, being bitten by a serpent, being afflicted with pain and high fever, or being injured by a weapon, one is immediately absolved from having to enter hellish life, even though he is sinful.
As stated in Bhagavad−gita (8.6):
yam yam vapi smaran bhavam tyajaty ante kalevaram
tam tam evaiti kaunteya sada tad−bhava−bhavitah
"Whatever state of being one remembers when he quits his body, that state he will attain without fail."
If one practices chanting the Hare Krsna mantra, he is naturally expected to chant Hare Krsna when he meets with some accident. Even without such practice, however, if one somehow or other chants the holy name of the Lord (Hare Krsna) when he meets with an accident and dies, he will be saved from hellish life after death.
– Srimad Bhagavatam 6.2.15
By constantly chanting the holy name for Madhavendra Puri, isvara Puri helped Madhavendra Puri remember the holy name at the time of death:
isvara Puri, the spiritual master of Sri Caitanya Mahaprabhu, performed service to Madhavendra Puri, cleaning up his stool and urine with his own hand. isvara Puri was always chanting the holy name and pastimes of Lord Krsna for Madhavendra Puri to hear. In this way he helped Madhavendra Puri remember the holy name and pastimes of Lord Krsna at the time of death.
– Sri Caitanya caritamrta Antya ila 8.28−29
Even if one cannot chant at the time of death, he still receives all benefits of chanting performed during his life:
At the time of death one is certainly bewildered because his bodily functions are in disorder. At that time, even one who throughout his life has practiced chanting the holy name of the Lord may not be able to chant the Hare Krsna mantra very distinctly. Nevertheless, such a person receives all the benefits of chanting the holy name. While the body is fit, therefore, why should we not chant the holy name of the Lord loudly and distinctly? If one does so, it is quite possible that even at the time of death he will be properly able to chant the holy name of the Lord with love and faith. In conclusion, one who chants the holy name of the Lord constantly is guaranteed to return home, back to Godhead, without a doubt. – Srimad Bhagavatam 6.2.49