You are free to compare yourself to others, as long as you use the information gathered to learn and improve.
But if you use that information to just pass a judgement, to look down on people or/and to beat yourself for not being successful, then you’ll never find achievement.
Observation is a tool of learning. It is not meant to mock others, or wreck yourself with guilt.