Essentially I have two options if I feel a bit envious:
1) Feel envy and get depressed because I start thinking I have a worse life.
2) Share in their joy - send a like, write a positive comment or sometimes just do nothing except focus on being excited for them . By sharing in their joy, I get to experience a bit of their happiness for myself. If I write them a comment, even if it's just 'Congrats!', then there's a chance I might even make them a little happier too - which in itself makes me happier.
This did not come naturally to me at first. I've worked on cultivating this attitude for many years. It's one of the best investments I've ever made in myself.