Every action has it consequences. The consequences of one’s actions are called “Karma”. Typically, good karma is Punyam and leads to benefits; bad karma is papam and it leads to hardship. When unpredictable bad things happen, Hindus attribute it to their bad karma, either from this life or from a previous life. Pious Hindus like to earn Punyam by doing good deeds and wash off their Papam through charity, penance, rituals and prayer. Sometimes it is hard to decide what is a good deed and what is a bad deed. The thought of Karma can paralyze pious people into inaction or remove their motivation to work. Krishna taught that if you do your duty, established in Yoga, not motivated by results, then Karma will not stick to you.
The part of the Vedas, called the Karmakanda (section on Karma), teach how to conduct your life and worship, in such a way that you have health, wealth, prosperity and all manner of material comforts on earth and then go onto a blissful life in heaven. Only the Vedanta and Upanishads discuss philosophy. The Vedas deal with the manifest universe. The manifest universe can be described by the three Gunas (qualities).
The Sankhyas turn away from material pleasures and from the Karmakanda of the Vedas. They believe that intellect and knowledge are higher than karma. Krishna said that Karma is far inferior to BuddhiYoga. (Union with God through the intellect).
The Gita says that one should be above the three Gunas and free from dualities like good and bad, pleasant and unpleasant. People whose intellect is carried away by matters related to experiencing luxury - Bhoga, and wealth do not attain Samadhi. Samadhi is a state of togetherness with the beginning, the First, ie with God. The wise give up the fruits of their actions and become free of the bondages of life. They reach the state of ‘Anamayam’ (Non-illusory? Free from evil?)
When you are free from illusion then you will know the difference between what you hear and what you ought to hear. When your agitated mind is still and in Samadhi, you will get rid of Karma and attain Yoga.