It is painful for a parent to see their child suffer. But we must understand that we humans only develop quality character through suffering. And if you protect your child from the pain you will make a weak cripple of them who does not have the character to withstand the troubles that will come in adulthood. Remember you are not going to live forever so your best protection for your child is helping them to know how to deal with suffering. The Bible says even Jesus learned obedience through the things that He suffered. ( Hebrews 5:8 ) Though He had a God side which was perfect He also had a human side which had to learn through suffering.
So when your child feels left out there are some pro-active plans that can be put into place that will use this time to build character. Begin by talking with your child about character qualities in good friends: they are a giver not a taker; they are kind to others; they are loyal; they are honest; they remain the same in character in any situation and are not two-faced. Once you have established this list with your child evaluate the people by this list who are rejecting him or her. This helps your child to see that these people are not worthy of their friendship. Teach them to say to themselves: "An opinion is only as good as the data it is based on. You do not have enough data on how valuable I am so your opinion is not worth much."
The next pro-active step is to look around for other children who are rejected and need a friend and begin to reach out and give kindness to them. The funny thing that often happens when a child shows kindness to the unpopular in a group or school, after a while, even some of the kids from the "Popular" group will join their group of friends. The reason for this is most kids in a popular group are unsure of their own worth and allow themselves to even be abused in order to gain some form of worth. But a group of friends that is formed on the basis of loving kindness and lifting up one another becomes far more attractive if this stays consistent. Your child will actually become the leader of this group because of their taking the initiative to reach out and help the others who are needy.
If some of the rejection is coming from an authority figure then teach your child to be respectful of the position even if they can't respect the person. Also help them see the character qualities they don't want to develop as they mature. As a parent you might try meeting with the coach or teacher and ask them if there are character qualities that would improve your child's performance. Just asking this question MIGHT get the authority thinking less of their irritation toward your child and more how they could also assist in the child's development. This has worked in some cases. This approach doesn't confront or shame the authority so there should be no reactive repercussions meted out on your child. It also looks like you believe the best in the authority and could influence better behavior from them. It often does.
So teach your child not to be reactive but pro-active in difficulties. that will serve them well all of their life.