I don't know where I read this or heard it, but years ago I heard some life-changing advice that I've applied over and over to increase my contentment. It is a simple way to not allow envy to limit your happiness.
If you see someone who has something you want, don't be envious of the thing that they have, but imagine if their entire life replaced your entire life, and see if you still want it.
There's a butterfly effect here: let's say you have a friend who just landed some awesome job that you would love to have, and he is talking about it all over social media. You start the internal negativity: that idiot got a job there, he wasn't even interested in that industry like I was, that should have been me, oh man where did I go wrong, the world isn't fair, this sucks, kittens are probably jerks too, etc..
It is easy to imagine your entire life being better if you just had the job, but everything in his life led him to that job. What if you just completely switched lives with him? Think of multiple aspects of his life: do you want all of it?
In most cases, you don't.
Well, then you couldn't be married to your wife, or have your kids - you'd have to take care of his kids and that dog that pukes everywhere and those neighbors he told you about.
It makes you take a broader view and allows the envy to float away.
And if you are still envious of the job or the car or the watch or whatever someone else has even after this exercise, then you have learned something important: whatever this thing is, is very important to you. Anything that envy wraps itself around over and over can be a good way to figure out what your real dreams are.