Comparing your life to the life of another can lead to depression, as comparison is both destructive and futile.
Comparing your life to the life of another is destructive as we compare our reality to the fabricated version of another person’s life. We only ever see the mask that other people have decided to show the world. The comparison between our “warts and all” existence and another person’s perfect facade is inevitably going to be destructive.
Comparing your life to the life of another is also futile, which cal lead to personal frustration. We cannot affect how another person chooses to live his/her life, and we shouldn’t try. We have no control there. Don’t bother - it’s futile.
Envy and jealously are very negative emotions, and we only ever experience them when we make comparisons. Forget about everybody else. Concentrate on you. Do you. That's where your power lies.
If you have a tendency to compare I would recommend doing the following:
Immediately stop comparing your life to the life of anybody else on the planet.
Compare your present to your past to see how far you've come.
Compare your present to the best possible version of yourself and use this comparison as motivation to work harder.