He who, before he leaves his body, learns to surmount the promptings of desire and anger is a saint and is happy.
Remembering whatever object one leaves the body at the end of life, one attains that object, O Arjuna, because of the constant thought of that object (one remembers that object at the end of life and achieves it).