Jesus said, “Judge not and you will not be judged.”
Elsewhere, Jesus said that if you forgive others, God will forgive you. Also, if you do not forgive others, God will not forgive you. He also told a parable to the same effect about a servant who owed a great debt to his master but wouldn’t forgive the small debt owed to him by a fellow servant.
So that way of reading Jesus statement about not judging is legit.
Also,if you don’t judge others, they won’t judge you. This isn’t a hard and fast rule, but in general, others will be more exacting about our behavior if we pass judgement on them first.
But here’s this other thing: if you don’t judge others, you won’t be judged by yourself.
When we judge another person, we place a wedge between them and ourselves. We attach a bit of ourselves to our perception of the other. This precludes the possibility of loving our neighbor as ourselves. We don’t allow ourselves to even know the other person as they truly are. In believing ourselves to be a proper judge (which is false) we believe a false idea of ourselves. We judge ourselves when we judge another.