17). Ishavasya Upanishad – Prayer on Death Bed

(May) this life (merge in) the immortal breath! And (may) this body end in ashes! Om! mind, remember, remember thy deeds; mind, remember, remember thy deeds!

At the time of death, past impressions may cover the mind and take one to the next life based on the impressions as Shri Krishna says in Bhagavadgita.

yam yam vapi smaran bhavam
tyajaty ante kalevaram
tam tam evaiti kaunteya
sada tad-bhava-bhavitah  – Bhagavadgita 8.6

Whatever state of being one remembers when he quits his body, that state he will attain without fail.

Last breath merges with the cosmic breath. The body is offered to fire.  The mind should merge in the absolute – remembering the Karma yoga and knowledge of SELF.

SELF-knowledge has to be fully established and one should live as Jivanmukta.  One who had glimpses of SELF-knowledge/Flashes of SELF-knowledge at the death bed praying for the mind to recollect the karma yoga and SELF-knowledge and free him/her after death instead of taking to another life form.

vāyur anilam amṛtam athedaṃ bhasmāntaṃ śarīram |
oṃ krato smara kṛtaṃ smara krato smara kṛtaṃ smara || 17 ||