Why do we behave negatively? Because we are hurt. A happy, joyful person will never do harm to anyone. Antidote to jealousy is the knowledge that everybody is going to die. You and the person, whom you are jealous of, are both going to die. It is better to compare yourself with your own self. How you were 10 years or five years ago and what you can be yet tomorrow. The fact that you are a sane human being is enough.
What to do if you are jealous of other people? One, know that the person has done some good karma in the past and they are now reaping the fruit. Two, take it as an inspiration to gain merit now. Three, create a sense of belongingness with them. See that they are a part of you. Four, think of all you have that they don’t have and feel grateful. Five, think of so many others who have much less than you have.
In the Gita, Krishn talks about all the good qualities. And then he adds that they are already in you. Just like in an atom, the core is positive and the negativity is peripheral. Don’t ever think deep inside you is all sorrow or anger or jealousy. Know that it’s not in the core.