yam yam vaapi smaranbhaavam tyajante kalevaram |
tam tamevaiti kaunteya sadaa tadbhaavabhaavitaha || 6 ||

When (one) thinks of whatever state, while leaving the body at the end, O Kaunteya, (one) always having been absorbed in that, attains only that.
yam : whichever
vaa api : any
smaran : thinking
bhaavam : state
tyajati : leave
ante : at the end
kalevaram : body
tam : that
eva : only
iti : that
kaunteya : O Kaunteya
sadaa : always
tadbhaava : having thought of it
bhaavitaha : attains
The Srimad Bhagavatam contains the story of the great king Bharata. He was an accomplished king. He ran his kingdom well during his lifetime, and later retired into the forest to lead a life of austerity. But he developed a soft corner for a baby deer and became so attached to it that he would only think of the deer instead of focusing on his austerities. It is said that in his next life, he was born as a deer.
In this shloka, Shri Krishna asserts that whatever we think about at the time of death will determine our fate. But more importantly, he also states that the thought at the time of death is not really something that we can control. It is in fact, an outcome of our pattern of thinking throughout our lives.
If we examine our thoughts over the course of our day, we will notice a great variety of thinking. For most of us it will be a mix of mostly family-related and work-related thoughts, mixed with some thoughts about spirituality. But in the background, we will always have a thought that is going on all the time. It will come to the forefront when we are alone, or when we have opened our eyes after sleeping, but not fully woken up. For King Bharata, that persistent background thought was that of the deer.
So then, our deepest love, our deepest interest and our deepest longing will bear fruit in our next life. Having known this, what should we now do? This is taken up next.