So your child comes to you because it feels wronged by what another person has done or said to him / her. Your child is at that point in need of empathy or at least sympathy. Your child needs to be heard because your child feels bad already, their feelings have been hurt. There is no use in kicking them while they are already down by telling them they do or say the same.
But what I keep seeing happening over and over is that a lot of people feel the need to point out that their child (or frequently I also see it happen between partners) has done or said such and such to others in the past as well.
Usually they know that quite well, there is no need in pointing it out. They feel bad as it is. No need to make them feel worse. The best course of action is to listen and empathise. That is what the child / person needs. After venting they'll feel a whole lot better and life can go on.
Pointing out their flaws at that point is going to create an argument and bad feelings and will not help your relationship with your child (or partner). The relationship between people living in one house or who are in a relationship of some sort is more important than pointing out flaws. We all have flaws. Nobody is a saint.
In case you decide you do want to discuss the particular point, that's fine, but wait with it until the child / person is in a better place. Once they are in a normal mood you can rationally discuss these issues, while making sure you use the techniques of non-violent communication. Otherwise you're going down the path of an argument again and nothing constructive will come of it. When you end up in an argument it will not help the relationship, nor will it create a situation where something can be done to remedy the issue.
When one of the parents sees the other parent do such things, the opportune action to take, is to discuss it and make sure that the relationship with the children doesn't get damaged any further. Explain why it's wrong and what the consequences will be. It is very well possible to damage a trusting relationship with children, or a partner for that matter, with making someone feel worse when they are already feeling bad. The task of parents is to make children feel safe and meet their needs. Not kicking them while they are already down. In general it's considered emotional abuse when this happens on a continuous basis between 2 partners, so why would anyone do it to children, who are more vulnerable to begin with.
Off my soap box again :-)
Please feel free to leave a comment or ask a question. I'd love to hear from you.