The Yoga Sutras of Patanjali state that to have peace of mind we need to cultivate four great virtues. These are (in Sanskrit, with translations):
Maitri -- friendliness, loving-kindness
Karuna -- compassion
Mudita -- sympathetic joy
Upeksha -- equanimity
I first heard of these concepts as the Brahma Viharas, or the Four Sublime States, as taught in Buddhism, but they are included in the Yoga Sutras as well (I.33). In Buddhism they're more often seen written in Pali, an ancient language related to Sanskrit: Metta, Karuna, Mudita, Uppekha.
Maitri / Metta -- The translation of the Yoga Sutras that I have says Maitri is friendliness. That's a good start, being friendly to people. In Buddhism, Metta is taken a step further and is translated as "loving-kindness". We practice to accept ourselves and others with friendliness and kind, loving understanding.
Karuna -- Compassion. We acknowledge the pain and suffering that others may be experiencing, and we practice being compassionate with them. We practice being patient with those who are suffering, and offer them assistance where we can give it.
Mudita -- Unselfish joy, sympathetic joy. We practice rejoicing in the positive accomplishments of others. The opposite of this would be being envious and jealous of what other people have accomplished.
Upeksha / Uppekha -- Some translations say "indifference" but I much prefer (and understand better) translating this as "equanimity". We accept what we can't change. Another translation that also resonates with me is "serenity" in accepting limitations in ourselves or in others, and rising above these limitations.
The virtue of Upeksha reminds me of the "Serenity Prayer" by theologian Reinhold Niebuhr:
God, grant me the serenity to accept the things I cannot change,
Courage to change the things I can,
And wisdom to know the difference.
A rough summary of B.K.S. Iyengar's commentary on this sutra (in Light on the Yoga Sutras of Patanjali, below) is that we are asked to rejoice with the happy, to be compassionate to the sorrowful, friendly to the virtuous, and practice equanimity with those who still live in a non-virtuous way, despite attempts to change them. This practice brings social and individual health. This approach to life keeps us serene and pure.