From an article (Head and Heart Together) by Thanissaro Bhikkhu
The brahma-viharas, or “sublime attitudes,” are the Buddha’s primary heart teachings — the ones that connect most directly with our desire for true happiness. The term brahma-vihara literally means “dwelling place of brahmas.” Brahmas are gods who live in the higher heavens, dwelling in an attitude of unlimited goodwill, unlimited compassion, unlimited empathetic joy, and unlimited equanimity. These unlimited attitudes can be developed from the more limited versions of these emotions that we experience in the human heart.
Of these four emotions, goodwill (metta) is the most fundamental. It’s the wish for true happiness, a wish you can direct to yourself or to others. Goodwill was the underlying motivation that led the Buddha to search for awakening and to teach the path to awakening to others after he had found it.
The next two emotions in the list are essentially applications of goodwill. Compassion (karuna) is what goodwill feels when it encounters suffering: It wants the suffering to stop. Empathetic joy (mudita) is what goodwill feels when it encounters happiness: It wants the happiness to continue. Equanimity (upekkha) is a different emotion, in that it acts as an aid to and a check on the other three. When you encounter suffering that you can’t stop no matter how hard you try, you need equanimity to avoid creating additional suffering and to channel your energies to areas where you can be of help. In this way, equanimity isn’t cold hearted or indifferent. It simply makes your goodwill more focused and effective.
Making these attitudes limitless requires work. It’s easy to feel goodwill, compassion, and empathetic joy for people you like and love, but there are bound to be people you dislike — often for very good reasons. Similarly, there are many people for whom it’s easy to feel equanimity: people you don’t know or don’t really care about. But it’s hard to feel equanimity when people you love are suffering. Yet if you want to develop the brahma-viharas, you have to include all of these people within the scope of your awareness so that you can apply the proper attitude no matter where or when. This is where your heart needs the help of your head.
Ajahn Thanissaro presents this most succinct and compelling introduction to the brahma-viharas (sublime states), and clarifies a host of misunderstandings straightaway.
While the sublime states are (by definition) boundless, we can start very simply by finding the place in our own hearts where we want to be happy, where we want to be relieved of suffering, where we want to be at peace — and then remember that all living beings share this desire.