As mentioned in the 'introduction the Bhagavad Gita', Lord Krishna spoke the Bhagavad-Gita on the battlefield of Kurukshetra, just prior to the commencement of the Mahabharata war.
The armies of the Pandavas and Kauravas are assembled at Kurukshetra. Lord Krishna is driving the Pandava Prince, Arjuna's chariot. Arjuna wants to see the opponents more clearly so he requests Lord Krishna, to drive his chariot into the midst of armies. The mighty warrior Arjuna sees his friends and relatives standing on the opposite side. He is filled with compassion and remorse and looses his interest in fighting.
Arjuna feels that no good could come from the war, as it is sinful to kill one's family, under any circumstance. Arjuna casts his bow aside, seeing Arjuna's confusion, Lord Krishna starts speaking.
Those who are wise, lament neither for the living nor for dead. Everything exists eternally. Although there is always some pain in loosing loved ones, the wise undergo that pain with patience and tolerance. They push on without letting grief overwhelm and ruin their responsibilities.
Krishna reminds Arjuna that happiness comes from right action that is ones duty. Arjuna's duty as a warrior was to protect the virtuous. No unhappiness could arise from performing ones duty, even if it involved fighting.
Enlightenment, the ultimate goal, is best achieved by Wise Action in which one acts out of duty only, without personal attachment.
Arjuna asks Krishna to make it more clear whether he has to fight or to renunciate.
Krishna states, "Everyone has to engage himself in some sort of work according to his qualities. Work done can either cause bondage to the material world or it can liberate one. One may not give up work and prescribed duties all of a sudden; but by gradually developing consciousness of the Almighty. One can find oneself in a transcendental position without being influenced by the material senses by steady intelligence directed toward one's pure identity".
Krishna also instructs Arjuna to fight to set the proper example of duty, to fight, but with knowledge and detachment and without falling victim to his own attractions and aversions.
He then recommends Arjuna to regulate his senses, become fixed in his pure identity as a servant of Krishna, and thereby avoid lust's control. Then, with spiritual strength and deliberate intelligence, he should conquer that forceful enemy - lust.