hi OP,
I'm very content. In my mind I have everything I've ever wanted: great career, great kids, home, loving husband, brilliant stuff to do in spare time. So much so that almost every day I catch my breath at some point and think: wow - how did I get this lucky?
Looked at through a more negative lens I could say I'm badly overweight with health problems, DH is out of work and has been for some time, the house is a tip and needs repairs we can't afford, I'm not that close to my family and don't have vast numbers of close friends. But even writing that feels very odd, because although it's all true, it's just not how I feel about life - it's very far from what I focus on. I love our big old scruffy home full of pets and plants and books and music. I love my big old scruffy husband, even though he is a grump who brings in very little money, because he's great with the kids and does his share of housework and is very funny and reliable and great at bear hugs and singing silly songs. The DC are brilliant and cuddly and funny and cute.
And so on.
You're right, it's a mindset and it is learnable to some degree. Lots of discontented people won't do the work that leads to contentment. I give thanks every day. You don't have to have faith, or thank anyone or thing in particular, but just list, consciously, on paper, in prayer or in your head, last thing at night all the small good things about that day. Do it every day. It helps you focus on the good stuff. Then it becomes second nature to do so, and the bad stuff loses its power over your happiness day to day.
Quit bitching, gossiping and hanging around people who bitch and gossip. These really do drain you. Keep an ear out for contented people and spend longer chatting to them.
Best advice I was ever given about envy: envy is a good thing. It's a way of learning what you'd like out of life. If you envy one person's home, not someone else's, it's because there's something about that home you aspire towards. Same with career/relationship etc. So you can then take steps to have similar, do similar work, behave in a similar way with people around you. Envy helps you focus on what you want most out of life.
Obviously if you envy six foot tall brunettes and you're five two and blonde, that's envy for something you can't get, but you can still transform that envy into a more useful emotion. It tells you you're not accepting of yourself, so you can then work on ways to feel better about who you are, as well as ways to look better in the skin you're in.