1 corinthians 5:12

12
What business is it of mine to judge those outside the church? Are you not to judge those inside?

its talking about its not "christians" place to judge "nonchristians", thats gods job. but we are to keep other "christians" right.

in matthew 7 its talking about the false prophets "christians" and that you will know that they are wrong by their actions, thats how you can judge someone.
“Beware of the false prophets, who come to you in sheep’s clothing, but inwardly are ravenous wolves. 16 “You will know them by their fruits. Grapes are not gathered from thorn bushes nor figs from thistles, are they? 17 “So every good tree bears good fruit, but the bad tree bears bad fruit. 18 “A good tree cannot produce bad fruit, nor can a bad tree produce good fruit. 19 “Every tree that does not bear good fruit is cut down and thrown into the fire. 20 “So then, you will know them by their fruits.

and then corinthians goes on to say
13
God will judge those outside. "Expel the wicked man from among you."

meaning kick those fools to the curb if they are claiming to be christians but are full of crap...