How can we uproot suffering and prevent ourselves from the harm of nonvirtuous karma?
This would require the work of transformation. We need to transform consciousness into wisdom to eradicate negative karma. Why are some people seem to enjoy good interpersonal relations and opportunities? These are the result of one's accumulated virtues. On the contrary, if one is filled with the five poisons (greed, aversion, ignorance, pride, doubt) and engage in nonvirtuous acts. One would damage the good conditions in life. Consequently, our interpersonal relations and many things in life wouldn't go as smoothly as we imagine. With greediness, we are frugal and unwilling to give. That’s why we can’t be along with others well. Aversion or hatred provokes conflicts and damages. Ignorance obscures our minds to become unclear, dull, and unreasonable. This is the fundamental reason why sentient beings downfall in samsara. Pride makes one fixate on "I" or "ego". Attachments, therefore, arise from ego. Doubt generates suspicion and could discourage one to lose faith. These are the result of not understanding the working of karma and cyclic existence.
The karmic memory drive of a sentient being contains good, bad, virtuous, and nonvirtuous information. Every individual is made up of a different memory drive. One has his or her thoughts, habits, and so forth. Sometimes, we can't help but complain when things aren't going well or that we're bad at communications. When we are not pleased with people, all sorts of emotions, entangled relations, etc. only becomes the fuel to push deeper into samsara. Hence, if we wish to be free from samsara, we need to purify ourselves and the karmic memory drive; cultivate loving-kindness, compassion, sympathy, and bodhicitta. We must strive to extend the positive connections with sentient beings. Furthermore, we can purify the karmic memory drives of ours and others’.
How can we purify our karmic memory drive? There needs to be a way. First, we must establish the right view, the proper understanding of the karmic principle behind all phenomena. Through the learning of the Four Noble Truths, we can understand the doctrine of Buddhism. Better yet, we can cultivate the proper acts and living through Dharma. Exert to appropriate our views and to stabilize our mind. Work steadily and a fruitful result is guaranteed.