Bhagavad Gita Shloka 8.6 — Aksara Brahma Yoga
यं यं वापि स्मरन्भावं त्यजत्यन्ते कलेवरम्।
तं तमेवैति कौन्तेय सदा तद्भावभावितः।।8.6।।
Meaning
Whatever state of being one remembers when leaving the body, that state one will attain without fail. The mind at the moment of death is shaped by the thoughts cultivated throughout life.