The pacification of consciousness is attained by cultivating friendship towards happiness/the happy, compassion with pain/the sorrowful, delight in virtue/the virtuous, and indifference towards the wicked.
This verse describes the proper attitude one must cultivate towards others, being dispassion with empathy, which in turn will stabilize and provide peace to our mind. This is akin to the Hindu Monastic Vow:
“The flies seek filth, the bees seek honey. I will shun the habit of the flies and follow that of the bees. I will refrain from finding faults in others and look only for the good which is in them.”
What a wonderful vow that we can all adopt as a formula for living and interacting with others!