The four qualities of the heart

Undisturbed calmness and clarity is attained by cultivating openness toward happiness, compassion toward suffering, delight in the good and equanimity toward evil.
The yoga sutras of Patanjali, 1-33

Those familiar with Buddhism may have recognised in this sutra the Brahma-viharas, the four quality of the heart (also known as the four sublime abodes or the immeasurables). This is not surprising, since at the time of Patanjali, Buddhism was the main religion in India, and Patajanli would of course have been familiar with Buddhist ideas. Like Master Gautama, he clearly states that these qualities have to be cultivated through practice. The Brahma viharas are relational qualities to be cultivated in all the conditions and events of our lives.

The first attitude to cultivate is an open heart that welcomes all that life brings its way with kindness (Maitri, or Metta in Pali, sometimes translated as friendliness). The cultivation of metta is powerful practice to uproot the deeply embedded psychological and emotional patterns of ill will and avertion. Metta can be cultivated through the well known Buddhist practice of Metta Bhavana.
When an open heart meets difficult, painful experiences (which it inevitably will, that the first of the four noble truth) it does not try to push them way. Rather,recognising that contracting around the pain and reacting with aversion and hatred only creates more suffering, it remains open and hold the pain, whether its own or that of others, with compassion (karuna).
When this open heart meets pleasant experiences, it doesn't cling to them, Rather, recognising that grasping would only gives rise to greed and attachment, and ultimately to suffering, it meets beauty and pleasure with joy and delight (Mudita).
Ultimately, these qualities come together in the development of a balanced mind that can be touched by the most abject suffering as well as the most sublime joy without being moved by either. This is equanimity (upeksa), which in Buddhism is both the last of the ten paramis (perfections) and the last of the seven factors of awakening.
Those interested in investigating these qualities and their cultivation may find Christina Feldman's book"Boundless heart" a very worthy read. This small but dense book explore kindness, compassion, joy and equanimity with great clarity and insight, and shows how cultivating them leads to a happier, freer and more fruitful life.