Let's get this out of the way: being jealous of a friend sucks. Mostly because you know you shouldn't be feeling that way towards a friend in the first place. You're supposed to cheer her on and celebrate her victories, but sometimes, it's really hard to not get jealous, especially if you want the same things and you both worked hard to get them and only she ended up achieving them.
There's nothing wrong about feeling sad, disappointed, and insecure with your friend especially if you know you both did your best. What's wrong is if you nurture that self-doubt and build it up until it comes to a point where you blame every misfortune that happens to you on your friend because you think she's getting in the way of your success, even if she isn't.
Remember that in every moment of your life, there will always be someone who will be better than you.
A classmate, co-worker, co-intern, relative or a friend. You are not always going to be on top and it is in moments like these that will make you want to learn more and be better.
When you feel like you're getting jealous over a friend, start acknowledging it, try figuring out your weaknesses, and think of ways you can improve it. Make it an inspiration to do and be better, because at the end of the day, there are things you have that your friend doesn't, and vice versa.
Be happy with yourself; jealousy is formed when you're discontented and don't acknowledge your capabilities.
It's hard to master your emotions but don't be overwhelmed by it. Stop comparing yourself to others. Focus on yourself. Write down the things about you that you are proud of and you'll be surprised that you are so much more than you think you are.
Everyone's stories are different and each of us have our own chapters in our book. Think of it this way, you and your friend are both in Chapter 20 of your respective books, but hers has 40 chapters while you have 60. Her life is going to have a second book while yours is still to be determined. It's hard to compare both books since they have different stories to tell, but still, both books are amazing reads.