How do we not dislike people who are better than us
The colleague who just got promoted, the classmate who always seems to get impressive grades even without putting that much effort, the neighbour who has a prettier lawn than you. Unless you're a literal saint, all of us have experienced feelings of envy and being the green-eyed monster. It's human to do so.
But why? Hating on someone doesn't necessarily help us to progress nor will it magically put a curse on the person to be bad at their job.
Here's why, the feelings of self-doubts, insecurities, shame that we tried so hard to bury emerge. It threatens self-identity, the image and the sense of self we tried so hard to craft and build.
Feeling envious of someone else isn't always the best and might take a toll on our mental health. Hence, here are some of the ways I think would be beneficial to overcome it:
⓵ At times, adopt the bronze medalist approach
A metaphor I learned from the book Hell Yeah or No by Derek Sivers: Instead of comparing up to the next-higher situation (like how a silver medalist compares themself to the gold), compare down to the next-lower one (like how a bronze medalist would be grateful to even win a medal). Gratitude really helps in relieving misery for not being "the best" and realizing how much worse it could have been.

⓶ Be multifaceted
A jack of all trades is a master of none, but oftentimes better than a master of one
For lack of a better term, tie your ego/self-esteem to different kinds of things, hobbies, skills, traits. Even if a specific skill does not work out well, it wouldn't have much of an effect on your perception of who you are, since you are more than just that one thing. In this arbitrary world crowded with talents and riches, there are always people better than you, but you'd be uniquely you that isn't easily comparable to anyone else.
⓷ Growth mindset >>> fixed mindset
By being jealous, you are indirectly admitting defeat, it's your subconscious mind telling you that you won't be as good as them. Rather than begrudging and murmuring "that should be me" bitterly, let people better than you be your "muse". Learn from them, incorporate new ideas from accomplished people and constantly remind yourself that mastery comes from effort, practice and resilience in the face of adversities.

All in all, a lot of things in life are relative, the idea of how successful/beautiful/rich/[you name it] we are tends to be related to how others are doing. Let's say in a hypothetical situation where you remain the same while everyone else around you becomes bad at the skill you tie your ego to. Comparatively, you will be at the top even if you didn't improve. So don't go too hard on yourself, instead of focusing on someone else's success, go forward one step at a time consistently, you'll reach your goals sooner than you think.
Any comments or feedback (or you just want to connect) can be sent here.