As humans I don't think there's any way around doing this; it's natural. It's natural because it is a defense mechanism. We need to do our best to know what is good or bad. A parent should judge their children's friends to know who is and who isn't a good influence.
We need to be careful not to judge someone by higher standards than we do ourselves. Do we get angry when someone lies to us? Of course. Have we ever lied? Do we get angry when someone is selfish? Of course. Have we ever been selfish? Do we get angry when someone isn't a good person? Of course. Have we ever not been a good person? The bottom line is don't put ourselves on a pedestal such as a judge in a courtroom. Show mercy to people who ask for our forgiveness because we often need forgiveness ourselves.
The fact is, there's more to the Bible verse about not judging others than at first glance. We've got to be aware of our surroundings. We need to assess situations and people for our own protection and the protection of our co-workers, family, and friends. We're all connected. I guess in some ways it boils down to how we act. We should be humble and remember that everyone is screwed up in one way or another. Having someone say that we're "Holier than Thou," isn't a good thing. We must be loving, kind, and compassionate. These things will make God proud.