If you are truly happy with who you are, you know who you are and are confident about that, judgement of others falls away.
Judging others comes when you are looking for justifications for your own situations, decisions, views, lifestyle etc or in my experience an unhappy marriage.
I would be seeing a counsellor to work through this you sound like you are not in a happy place.
It sound tee but when. Had the greatest judgements and not happy with other was when I was really unhappy with myself.
Changed things and became happier with myself and then less critical of others ( in a bad verbal way). Very happy to judge inside my head.