Chapter 8 Brahma Yoga Verse 5
Shloka
Antakaale cha maameva smaran muktwaa kalevaram;
Yah prayaati sa madbhaavam yaati naastyatra samshayah.

Translation

And whosoever, leaving the body, goes forth remembering Me alone at the time of death,
he attains My Being; there is no doubt about this.
Interpretation
Starting from this sloka Lord Krishna shares with us the different scenarios that people undergo at the time of the death. He starts this sloka with those people who remember Him alone at the time of the death. He says that those, while dying remember Him and only Him but nothing else will attain the God’s being. Attaining the God’s being doesn’t mean moksha. It means that the person will have a death where the enlightenment of the Lord gives a sense of purity to the soul, while it is moving out of the body. This is an undoubted truth, says Lord Krishna.
Extending Interpretation to Mankind’s Life!
Death is a moment which is indescribable to any human because the feeling caused can only be known to God. Lord Krishna being a God is explaining to the ordinary humans what different people undergo at the time of death. People think of their money, people think of their responsibilities, people think of their near and dear, people think of the urge to live more and enjoy at the moment they are dying. How many people really think of God? That particular moment of death those who really have put God in their heart and mind will only think of God and die.
Many of us know the last words of Mahatma Gandhi, while he was shot on his chest by Godse and he was about to collapse. The 80 year old frail body of Mahatma uttered “Hey Ram” and he closed his eyes and peacefully passed away. A man, who kindled millions of hearts with a sense of patriotism and showed a different path of life, a man who was serving the riot victims of Bengal on 15th August, 1947 while the whole nation was celebrating Independence, could not think of anything but God at the time of his death. Lord Krishna says that such people who have Him in their mind while dying attain His being.
That brings us to the question of what is “His being”? God’s being is nothing but holiness. Whatever maybe the circumstance in which we die the soul should be pure and holy while it is leaving the body. The pure soul which has nothing but God and His thoughts in it, will not be restless and will be able to go into the astral worlds and can decide upon its re entry into another body. And such a soul when it re enters into another body then that body will have the ability to control the senses and emerge as a spiritual being even at an early age.