TLDR; People don’t have the same situation, strength, weakness, financial situation, family, or friend circle as you.
If you want to compare, compare yourself to the past you from last week, month or year. (Learned it from Jordan Peterson) That is a good metric to understand your growth, what you have been through and how far have you come along.
I remember one of my friends was sad about the promotion of his colleague to a Senior Manager role when he was just promoted to Manager. He complained about how much he worked — day and night. Still, people his age are in more senior roles. He was comparing apples to oranges, so I reminded him that he started from a lesser-known college, got into the company through a service role, and got 3 promotions in less than 2 years to a Manager level. He shouldn’t compare himself to other people because his growth from where he started is far higher in my perspective than the other person.
Comparing your current life situation lacks depth and history. Comparing yourself to where you are vs. others is an inaccurate metric. At best it makes you feel bad, is easy to do, and doesn’t give you insights into improving.
Comparing yourself with others is healthy when it helps you develop as a person and it doesn’t stress/bother you. For example, you can compare and question how others set their life goals and how they handle different social situations. This teaches you to look for new ways of handling things that you weren’t aware of before and it helps you grow.
I have developed a habit after many years where looking at people doesn’t make me jealous but it makes me curious about how things/people work. I tend to ask a lot of questions that drive me to be happier.