Bhagavad Gita: Chapter 8, Verse 6

यं यं वापि स्मरन्भावं त्यजत्यन्ते कलेवरम् |
तं तमेवैति कौन्तेय सदा तद्भावभावित: || 6||

yaṁ yaṁ vāpi smaran bhāvaṁ tyajatyante kalevaram
taṁ tam evaiti kaunteya sadā tad-bhāva-bhāvitaḥ

yam yamwhatever; or; apieven; smaranremembering; bhāvamremembrance; tyajatigives up; antein the end; kalevaramthe body; tamto that; tamto that; evacertainly; etigets; kaunteyaArjun, the son of Kunti; sadāalways; tatthat; bhāva-bhāvitaḥabsorbed in contemplation


BG 8.6: Whatever one remembers upon giving up the body at the time of death, O son of Kunti, one attains that state, being always absorbed in such contemplation.


We may succeed in teaching a parrot to say “Good morning!”  But if we press its throat hard, it will forget what it has artificially learnt and make its natural sound “Kaw!”  Similarly, at the time of death, our mind naturally flows through the channels of thoughts it has created through lifelong habit.  The time to decide our travel plans is not when our baggage is already packed; rather, it requires careful planning and execution beforehand.  Whatever prominently dominates one’s thoughts at the moment of death will determine one’s next birth.  This is what Shree Krishna states in this verse. 

One’s final thoughts will naturally be determined by what was constantly contemplated and meditated upon during the span of life, as influenced by one's daily habits and associations.  The Puranas relate the story of Maharaj Bharat.  He was a king, but he renounced his kingdom to live in the forest as an ascetic and pursue God-realization.  One day, he saw a pregnant deer jump into the water on hearing a tiger roar.  Out of fear, the pregnant deer delivered a baby deer that began floating on the water.  Bharat felt pity on the baby deer and rescued it.  He took it to his hut and began bringing it up.  With great affection, he would watch its frolicking movements.  He would gather grass to feed it, and would hug it to keep it warm.  Slowly, his mind came away from God and became absorbed in the deer.  The absorption became so deep that, practically all day long, his thoughts would wander toward the deer.  When he was about to die, he called out to the deer in fond remembrance, concerned about what would happen to him.  Consequently, in his next life, Maharaj Bharat became a deer.  However, because he had performed spiritual sādhanā, he was aware of the mistake in his previous life, and so even as a deer, he would reside near the āśhrams of saintly persons in the forest.  Finally, when he gave up the deer body, he was again given a human birth.  This time, he became the great sage Jadabharat, and attained God-realization by completing his sādhanā.

One should not conclude upon reading the verse, that for the attainment of the ultimate goal, the Supreme Lord is only to be meditated upon at the moment of death.  This is well-nigh impossible without a lifetime of preparation.  The Skand Purāṇ states that at the time of death it is exceedingly difficult to remember God.  Death is such a painful experience, that the mind naturally gravitates to the thoughts that constitute one’s inner nature.  For the mind to think of God requires one’s inner nature to be united with Him.  The inner nature is the consciousness that abides within one’s mind and intellect.  Only if we contemplate something continuously does it manifest as a part of our inner nature.  So to develop a God-consciousness inner nature, the Lord must be remembered, recollected, and contemplated upon at every moment of our life.  This is what Shree Krishna states in the next verse.