Dharma in the Bhagavad-Gita is defined as right action. Dharma is subjective—it depends on the person involved and his or her particular context. What is good dharma or right action for one person might be bad dharma or wrong action for another person. What is good dharma in one time or place may be bad dharma in another.
Dharma has a strong ethical component, as it means doing the right thing for the right reason. It is sometimes, therefore, translated as doing one's duty. For example, in the Bhagavad-Gita, the Lord Krishna advises Arjuna that his embrace of non-violence is not part of his dharma, or duty. His dharma is to fight. As Krishna explains, Arjuna's hesitancy arises from wrong reasoning: it is a weakness of the heart. Because Arjuna is a warrior, he will not fulfill his true destiny in life if he refuses to fight. Instead, he will become a sinner.
However—and this is an important point—even though fighting is the dharma of a warrior like Arjuna, another person's dharma or right action might very well be non-violence. As Krishna states:
One’s own dharma, performed imperfectly, is better than another’s dharma well performed. Destruction in one’s own dharma is better, for to perform another’s dharma leads to danger.
One's own soul must learn through worship so that one can be instructed by the divine force and rightly discern one's dharma.