I don't really know how you teach compassion. I believe some children in their little personalities and temperaments are more compassionate than others. Toddlers who are highly sensitive seem to grow into more compassionate children and adults. However, it is such an important character trait that it can't be something we just leave us to 'nature' to build (or not) in our children.
Children learn from us
The other day I found out that one of my friends had cancer. I heard the news and in complete devastation burst in to tears. The kids were in the room. My eldest became concerned and asked me why I was crying. I told him that I felt sad that my friend was sick because it would mean life would be really hard for her for a while. He looked at me and said "It's nice you're crying for your friend". I love my kids!
Similarly, my boys have seen me stop to help someone or talk to someone who might be perceived as a bit um, weird. One of my son's asked me "Why do you always talk to people you don't know?" after I had stopped and had a conversation with an elderly lady at the supermarket. I saw that as my opportunity to tell him that sometimes people might be lonely or sad and it can make them feel better if we take the time to chat with them and show kindness to them. I know that I learnt from my mother who was (and still is) amazing in how she always takes time to chat with anyone and everyone.
I try to be mindful that my kids are watching us! My husband is in the Philippines at the moment so it has been a great lesson for the kids in so many ways. But one of those is in compassion. Why has daddy gone to the Philippines? What's he doing there? Yes, he's helping kids who don't always get to have food. That is only part of it but hopefully something that my young children can understand.
Children learn from each other
My 5yo is a completely different personality to my eldest. My eldest is naturally sensitive and compassionate and most of the time, considerate of others. DS2 is the opposite. I have had to tell him. "If you hurt someone, even if it's an accident, the right thing to do is ask if they are okay!". I taught him to be compassionate (even if it doesn't come naturally). He now does this regularly if he sees someone hurt or sad. I've watched my youngest observe this and start to do it also by asking his big brothers if they are okay if he sees them upset.
Children learn from each other.
Compassion is something that comes naturally to me and I find it difficult and a bit confronting when others don't share my view. I want to make sure my children are raised knowing that caring for others, even so deeply that it sometimes hurts, is better than being cold and indifferent.
Compassion is a character trait that I want to instill in my children!