I don't think it would be about what I'd tell the child. It would be, instead, about what I'd try to teach the child. The child who has a mean rival or two could be any child who is unfortunate enough to run into such kids, but a child who isn't liked by most/all of the other kids often is doing something that makes the other kids not like him.
Although there will always be the occasional kid who doesn't like another one because of some good trait/characteristic, such envy/jealousy isn't the cause of being disliked as often as many disliked kids tend to assume it is. In general, children, particularly in primary school and even early middle school, don't usually dislike anyone who doesn't bother them, or else have some attitude or behavior that makes them unlikeable to so many other kids.
Children who lack social skills are often not liked very well because they're dealing with other children who, of course, don't know how to be understanding of another child who lacks social skills. Also, children who think too highly of themselves as human beings - in other words, who feel superior to others as a result of whatever "good characteristics" they have - tend to be disliked. So, too, though, do some children who think too little of themselves and who therefore do socially awkward/distancing things out of insecurity.
When my own children were very little, part of what I made sure to teach them was that having good friends came from being a good friend. I'd talk to them about the kinds of things that "good friends" do and don't say to other children. I made sure they knew that even though they were special and loved and worthy of being liked/loved, so, too, were all the other children they knew. Because I generally like most people, they learned to see others through a positive lens, at least most of the time; and that helped them see themselves and others through the same positive lens. If they told me about something negative or objectionable about another child, I'd put it in perspective and in a way that helped them understand that perfectly fine other children can have the occasional "issue" through not fault of their own.
In other words, I aimed to help my kids like not only who THEY were, but other people as well. It all goes back to aiming to teach them they're not better or less than anyone else, because if they truly feel they're equal to others it's easier to just relax and be their own, likable and authentic self.