How is it possible to be happy for someone else when they experience a joyous time in their lives and you are left waiting and watching?
Such a situation comes up all the time - when someone gets a job and you are still looking for one, when someone gets into a school/seminary/college that you wanted to get into, when a friend gets engaged before you - it's a challenge many of us experience on some level.
It boils down to learning how to deal with disappointment on your end while at the same time being happy, really happy for your friend's good fortune.
The first thing to remind yourself, although you know this in your sleep, is that Hashem runs the world and He knows what is best for you. He does everything not just for a reason, but for a good reason! You don't know why He decided that it's best for your friend to get into that school, to get that job or to get that guy - all before you but He knows why it's best!
There's a mashal you may have heard about a tapestry - when someone is sewing it, if you look from the bottom, it looks like a big mess and you can't see or understand the beauty of the big picture. All you'll see are knots and a mixture of colorful strings hanging around. However, if you sit up on top, you'll get to see a beautiful picture with details you never would have imagined when looking from below.
I think the nimshal is pretty clear. When we are down here on this world, we don't understand the seemingly unclear, messy threads that are hanging from up above. But after 120 years, when I person goes up there, they can see with 100% clarity the beauty in the tapestry Hashem has sown!
Another thing to keep in mind is that someone else's good fortune will not in any way take away from the good you are going to have when your time comes. You will get to experience that joy and happiness when Hashem decides the time is right for you. Everyone has their time and everyone has their yeshuah that is going to come for them!
The job your friend got is perfect for her and even if you think you could have gotten it or would have gotten accepted if not for her, it's not true! If you would have gotten that job, it may not have worked out best for you - the traveling, the coworkers, the environment, your relationship with the boss, your schedule or whatever else it may be. Hashem has His plans and He has a reason why He made it that she got the job and not you. But this does not take away from your good and your chance - you will get something that's good for you! Just keep davening!!
That school/college/seminary was obviously not meant to work out for you because had you gone there, you would not be the person you are a few years later. You may have learned things differently or come out with different hashkafos had you gone there. You wouldn't have made the friends you have today had you gone there - because Hashem put you in this specific place (whether it's a school/college or seminary) so that you could get to know people who you can form relationships with that will be a benefit for you.
That guy your friend got engaged to is perfect for her. Even if it seems like he has some of the qualities you are looking for (which makes sense because friends tend to be similar so they may be looking for similar guys), he is her guy! There are little details and nuances of his personality and background that will make it work for the two of them to get married and it just wouldn't work out for you. Iy"h they will make a great couple together! Hashem has someone in mind for you and her simcha, her joy will not in any way take away from the joy you will experience when you get yours! In fact, it may be multiplied because of the things you have gone through to get to that point! When you wait for something and you finally get it, it's so much more precious and you appreciate it so much more!
Were you ever jealous of someone else's glasses prescription? Why not?
It's because this is something they need to be able to see better and if you wore their glasses, not only wouldn't it help you see more clearly, it may even cause you to bump into things because it's too strong or too weak for you. Your friend's glasses are made to fit her eyes so that when she puts them on in the morning, she can see with 20/20 vision. You don't need her glasses to see well! So of course there's no purpose in wanting them!
If only we were able to view life with such crystal clear vision, viewing other people's joys in true jealous-free lenses, the world would be a much happier place. May you always be able to feel real joy when you hear about other people's simchos and good fortune and may each of you be able to experience your own yeshuah soon!
And one more thing - don't stop davening! Thank Hashem for the goodness He bestowed upon your friends and keep asking Him to give you that which you have been davening for all this time!