You will be grateful toward your friend, and your friend might feel inspired and grateful too, if you tell the person that he or she helped you to evoke your compassion. The simplest ways are the best and the most direct. Every day, life gives us innumerable chances to open our hearts, if we can only take them. Any one of these sights could open the eyes of your heart to the fact of vast suffering in the world. By doing this you will realize how blind you have been to suffering, how the pain that you are experiencing or seeing now is only a tiny fraction of the pain of the world.
Compassion is a far greater and nobler thing than pity.
To train in compassion, then, is to know all beings are the same and suffer in similar ways, to honor all those who suffer, and to know you are neither separate from nor superior to anyone. So your first response on seeing someone suffer becomes not mere pity, but deep compassion. You feel for that person respect and even gratitude, because you now know that whoever prompts you to develop compassion by their suffering is in fact giving you one of the greatest gifts of all, because they are helping you to develop that very quality you need most in your progress towards enlightenment. That is why we say in Tibet that the beggar who is asking you for money, or the sick old woman wringing your heart, may be the buddhas in disguise, manifesting on your path to help you grow in compassion and so move towards buddhahood. When you meditate deeply enough on compassion, there will arise in you a strong determination to alleviate the suffering of all beings, and an acute sense of responsibility toward that noble aim.