Remembering Me alone in the end, whoever exits from the body and proceeds, attains My state. There is no doubt in this.
Arjuna raised seven questions in the beginning of the chapter (8.1,2). And this is the answer to the last of them.
People have a strong urge to leave the body thinking of God. But how will this be possible? In answer, Krishna says that all thoughts should always be around God or Self. That will safeguard one’s departure and whatever would follow it.
Thinking about God during the end is itself sufficient for shaping the outcome thereafter. Such devotees will become like Krishna, in essence, or join Krishna’s spiritual state. There is no doubt about this at all.
How can Krishna give such an assurance? Mind, a product of Nature, has its own law, like any other material law or force. Mind’s law is that “as it thinks, so it becomes.” To change the character or quality of the mind, you have to change the thoughts. Then the outcome also changes accordingly. This transpires irresistibly, as in the case of any other law or process of Nature.