The Gita lays stress on the focus of the consciousness at the time of death as an important element for the transition and the soul’s evolution. Sri Aurobindo points out that this has nothing really to do with concepts such as last rites, deathbed conversions or fortuitous dying at some holy location, without the prior direction of the life and the soul’s aspiration being aligned with the direction. He makes it clear that the direction and momentum of the soul at the time of the transition to the death state, and the successive states thereafter, including taking a new birth, are founded in the effort and concentration of the soul during the lifetime.
Sri Aurobindo attributes the process to what he calls “the self-creative power of the consciousness.” “What the thought, the inner regard, the faith, sraddha, settles itself upon with a complete and definite insistence, into that our inner being tends to change. This tendency becomes a decisive force when we go to those higher spiritual and self-evolved experiences which are less dependent on external things than is our ordinary psychology, enslaved as that is to outward Nature. There we can see ourselves steadily becoming that on which we keep our minds fixed and to which we constantly aspire.”
Eventually as we carry out this focus, we fix firmly the new direction of the soul and it pervades the entire being to such a degree that it cannot be shaken with trauma, pain or death. Thus, “In the critical moment of passing from the mortal plane of living, the importance of our then state of consciousness becomes evident. But it is not a death-bed remembrance at variance with or insufficiently prepared by the whole tenor of our life and our past subjectivity that can have this saving power.” Rather, “the divine subjective becoming on which the mind has to be fixed firmly in the moment of the physical death…must have been one into which the soul was at each moment growing inwardly during the physical life….”
“For it is by thinking always of him with a consciousness united with him in an undeviating Yoga of constant practice that one comes to the divine and supreme Purusha.”
Sri Aurobindo, Essays on the Gita, Second Series, Part I, Chapter 3, The Supreme Divine, pp. 281-282