Bhagavad Gita · Chapter 8: The Imperishable Absolute
Bhagavad Gita 8.5
अन्तकाले च मामेव स्मरन्मुक्त्वा कलेवरम् ।
यः प्रयाति स मद्भावं याति नास्त्यत्र संशयः ॥
antakāle ca māmeva smaranmuktvā kalevaram | yaḥ prayāti sa madbhāvaṃ yāti nāstyatra saṃśayaḥ ||
One who, at the time of death, leaves the body remembering me alone, comes to my state of being. Of this there is no doubt.
Modern context
What fills the mind at the end shapes where a person goes. Remember the divine as you leave the body, and you reach the divine. The promise is direct and the condition sounds simple. But the next verses make clear why it is not. At the moment of death we cannot suddenly choose our last thought. It will be whatever we have practised most. The verse is really about how we live.