The Buddha’s teaching on karma is one of the ways in which the Dhamma offers external protection: It emphasizes the importance of your present actions—providing for the possibility of “should be done” and “shouldn’t be done”—at the same time offering clear guidelines for figuring out, in any situation, where the shoulds and shouldn’ts lie. This is one of the ways in which the Buddha’s Dhamma offers external protection in all directions. It gives you tools to discern, regardless of time or place, which actions always lead to long-term suffering, which ones always lead to long-term happiness, and then lets you “decide for yourself which path you want to follow.”
In choosing to follow the Buddha’s path to happiness—both long-term and beyond long-term—which you’ve learned from the external level, you begin to take refuge on the internal level. In other words, you internalize the examples provided by the Buddha, Dhamma, and Saṅgha, developing them in your own thoughts, words, and deeds. This is a form of refuge in that you protect yourself from the dangers that would come from following unskillful actions and habits of mind.
Internalizing the refuge of the Buddha means developing the three main qualities he embodied: discernment, compassion, and purity. To do this, you look to the Dhamma for advice on how to foster these qualities within yourself.
Discernment, it says, comes from trying to find an answer to the question, “What, when I do it, will lead to my long-term welfare and happiness?”
Compassion comes from realizing that other beings love themselves as much as you love yourself, and so your happiness should never depend on causing them harm. Otherwise, it won’t last.
Purity comes from examining the actual results of each action—before, during, and after the action—to see if it will cause, is causing, or has caused anyone any affliction. If it will cause affliction, you don’t do it. If it is causing affliction, you stop. If it has caused affliction, you talk it over with a reliable friend and then resolve never to repeat that mistake. If it didn’t cause any affliction, you take joy in being harmless and continue with your training in skillful actions.
This reflection by Ajaan Geoff is from the book, Beyond All Directions, (pdf) pp.8-9.