This is the teaching of the Buddha. The above verse encapsulates the entire teaching of the kind compassionate Buddha. In it, He is telling us sentient beings, who want only happiness and do not want suffering, how to achieve our aims. Happiness and suffering do not come from outside but from actions motivated by our own minds, our own thoughts. Happiness comes from positive actions.
Problems come from mistaken, or unskillful, actions.
Positive actions, pure actions, are motivated by a positive, virtuous attitude, the pure mind, the healthy mind, the peaceful mind. Liberation is the complete cessation of all suffering, including rebirth, aging, sickness and death , and its cause. Enlightenment, the great liberation, which is even higher than this, is the cessation of even the subtle defilements of mind and the completion of all realizations. Each and every sentient being has the potential to experience all this. It comes from positive motivation and good karma.