Two feelings, one moment
A friend gets the place on the team, the offer, the great result, the new thing. You type 'so happy for you!' and mean it. You also feel a small, sour twist underneath.
That does not make you a bad friend. Most people feel both at once. The twist is usually a sign that you want something too, not a sign that you want your friend to have less.
What the sting might be telling you
Try finishing this sentence privately: 'I wish I had...' It might be the news itself, or it might be something under it, like more time, more confidence or more notice.
You do not have to share the answer with anyone. Just naming it often makes the sting smaller and easier to carry.
One small thing to do
Send the congratulations first, while the happy part is in charge. Keep it short and specific: 'You worked so hard on this, I'm really glad it paid off.'
Then ask one curious question, such as 'What are you most looking forward to?' Questions keep you in their good news instead of comparing it with your own.
If the sting lingers
Give it a day. Feelings like this usually fade faster when you do not feed them. If it is still there, turn it into a small goal of your own: one step toward the thing you wished for.

