I wouldn't say I'm an expert in this area, but I have made some large strides over the past few years. It's definitely something I had to "seek out", for reasons I'll explain here. I used to obsess all the time over how I compare relative to others, and was generally walking around feeling terrible with constant reminders everywhere of how I compare to others, now I only have these thoughts occasionally and when it does happen, I can dismiss the thought relatively quickly. This was only possible through a couple years of intentional effort to unlearn comparison-related thought patterns.

In practice, I'd say the feeling of "contentedness" is less of a feeling of "coolness" or "relaxation", and more like a very "normal" feeling (like how you already feel 90% of the day) where your head is either kind of empty or running full of random things. It's mostly about the absence of negative spirals of thinking.

As far as the changes I made, the specific steps I took were along a framework of addressing habits. I think that fleeting thoughts of comparing to others are kind of like an addictive habit like smoking. First a thought like "others are doing better / are happier than me / I should be doing xyz to be happier" comes, either for no reason or from some environmental trigger, and then you dwell on the thought which is what causes the unhappiness.

One possible step is removing triggers - I think these triggers tend to be social, so if you're surrounded by people who constantly brag or make verbal comparisons to others, spend less time with them if you're able to, and spend more time with others that you enjoy the company of. Also, as bad as it sounds, it's also useful to spend less time around friends who are unhappy / have bad mental health and spend more time around happy people (or pets), I think mindsets of optimism and contentedness can rub off when they're "normal" (i.e., if everyone around you thinks in that way).

In my case, I started spending a lot less time with a particular depressed friend (it felt like a shitty move at the time, but after improving my situation I was able to come back and spend time with them again in a more resilient mindset where their thought patterns don't rub off on me), talking way less with my parents who were comparing me to others a lot (ditto about feeling like a shitty move at the time but being able to come back), began having way less depressing / "deep" / "philosophical" conversations with friends, and spent more time with friends and acquaintances (+ my cat) who seem social and who don't talk about themselves/others too much.

Along this vein, my litmus test for whether I consider a friendship to be positive for me was, "if this person ends up more successful than me, would I be happy or jealous?". If I'd feel happy, then it's because I deeply care about them, the same way I would be happy and excited if my sister or parents struck it rich. If I feel even slightly jealous, then it's because I don't genuinely care about them in the same way, instead I'm using them as an index for how successful I want to be, and any friendship resulting from that will be full of social comparisons and won't be enjoyable for me. Also, cutting social media feeds (but still staying on messaging apps like Messenger, Instagram DM, WhatsApp, etc.) was also a really good move, basically it eliminated the downside of social comparison while keeping the upside of social connection.

The second step is removing "dwelling" on these fleeting thoughts like "am I happy?" "are others happier?" etc. A band-aid solution is to dismiss such thoughts when you recognize them by acknowledging that your circumstances are pretty good and that it's a bit vain to obsess over your personal happiness levels when things are already pretty decent. I used the statement "stop being so vain" to dismiss these thoughts for a while which seemed to work pretty well. Eventually I didn't have to use this bandaid because I just unlearned the habit of dwelling.

With that said, this is just my approach and what worked for me, everyone has different circumstances etc., but I'm sure some of it could translate to others' circumstances. Hope this helps!