Dharma is commonly defined as the right way of living, adhering to the truth, being conscious of our speech, thoughts and actions, being compassionate, and being aware of the presence of the supreme power.
However, dharma goes further than this condensed, moral foundation for conduct. Simply following the road of ethical living, or leading a morally upright and peaceful life, would not bring about moksha, the hard value. It is an investigation of one’s true nature, which can only be accomplished by vairagya, dispassion; vichara, reflecting; viveka, discrimination; and nidhidhyasa, meditation. Dharma cannot be attained by reciting the shlokas and studying sacred scriptures.
The ultimate goal of life is to uphold dharma, not to adhere too closely to artha and kama. This is Sanatan Dharma, which has nothing to do with the caste system, or other social ills that developed in post-Vedic society.