etairvimuktaha kaunteya tamodvaaraistribhirnaraha |
aacharatyaatmanaha shreyastato yaati paraam gatim || 22 ||

One who is free from these, the three gates of darkness, does good to himself, O Kaunteya, and with that, attains the supreme goal.
etaihi : these
vimuktaha : free
kaunteya : O Kaunteya
tamodvaaraihi : gates of darkness
tribhihi : three
naraha : one who
aacharati : does
aatmanaha : himself
shreyaha : good
tataha : with that
yaati : attains
paraam : supreme
gatim : goal
Shri Krishna describes the fate of one who has successfully conquered desire, anger and greed, the three gates of tamas or darkness. He says that such a person, from a practical standpoint, puts his life on the right track, he does good to himself. From an absolute standpoint, such a person attains the supreme goal of self realization, of oneness with Ishvara, instead of entrapment in the never ending cycle of birth and death.
With this shloka, the message of the entire sixteenth chapter is summarized and concluded. Most of us, given the materialistic nature of the world, are on the path of preyas, the pleasant, the path of continuous satisfaction of selfish desires. Shri Krishna urges us to slowly tune down the three devilish qualities of desire, anger and greed, so that we can start walking on the path of shreyas or the auspicious, the path of the divine qualities. Only then do we become qualified to attain the supreme goal of self realization.
Having heard this, we probably have a question that arises in our minds. Every second of our lives, we are bombarded with a ton of desires. If our awareness level is high, we can regulate them some of the time, but not all of the time. Furthermore, anger can erupt and take over our mind within a microsecond. How can we, on our own, control desire, anger and greed? It is not easy. Anticipating this question, Shri Krishna answers it in the next shloka.