Here is an illustration: walking along a street at night, you see a toad; you find it repellant, and decide to crush it with your foot. As you step on it, you discover it is just dog shit. Simultaneously, you have received retribution for past karma and have created new karma. Stepping on shit in any state of mind is receiving retribution; but stepping on it thinking it to be a toad, you have created new karma. In this case, however, you are lucky and the karma is light, because you did not actually kill. If, afterward, you reflect on your actions and feel remorse, the karma is lightened. This is good practice. If you reflect regularly after all actions that is excellent practice. Eventually, you may reach a point where your actions are no longer motivated by affliction.
However, reflecting after the fact is, in a sense, too late. To one degree or another, karma has already been created. Thus, you can improve your practice by reflecting before you act. Whether it is good, bad, or neutral karma depends on the intention behind the action. Of course, terms like good and bad are relative and subjecttive. What is good in one situation might be bad in another. What one person or culture considers good, another person or culture might consider neutral or bad. In general however, Buddhism states that good karma is created by thoughts, words, or actions intended to lead one toward liberation. Good karma is also created when one does things that lead to accumulation of merit and virtue. Bad karma is created by any thought, word, or action intended to cause overt suffering in oneself or in another. Notice that the intention or motivation is more important than the actual deed, and it is one’ s attachment to self and to outcomes that creates vexation. However, if you reflect immediately after vexation arises, you have altered the future effect for that act in the sense that a positive condition has altered the whole process of creating this karma. Not only that, but you will also have learned to be more mindful and will perhaps better control your actions in the future.