The Heart and The Fruit
Whether in Sunday school or perhaps more likely, in everyday conversation, you have likely heard someone say something along the lines of, "Don't judge someone's actions; only God knows their heart." Sometimes they will even cite, allude to, or paraphrase the story of David's anointing.
Is that an appropriate reading of 1 Samel 16?
In 1 Samuel 16 Samuel goes to Bethlehem seeking the son of Jesse that YHWH wants to anoint as king. Samuel offers a sacrifice and invites Jesse and all his sons to see which might be the one YHWH wants. Then, we read in v.6:
"When they came, [Samuel] looked on Eliab and thought, 'Surely YHWH's anointed is now before YHWH.' But YHWH said to Samuel, 'Do not look on his appearance or on the height of his stature, because I have rejected him; for YWHW does not see as mortals see; they look on the outward appearance, but YHWH looks on the heart.'"
The point here is not that Eliab is a bad person, despite having done otherwise apparently morally good things, nor the opposite. No, the point is that his stature and height, i.e. his literal physical appearance, is not what God primarily values in a king (someone who, especially in antiquity, needed to be pysically strong) but rather, a heart set on seeking God and living out his ways. To use this passage as a call to not judge behavior is simply misguided and ignoring the literary context of the passage.
Compare that idea with the words of Jesus in Matthew 7:15-20, which says quite clearly that we will be able to tell if a person is good or bad, based on their behavior:
"Beware of false prophets, who come to you in sheep's clothing but inwardly are ravenous wolves. You will know them by their fruits. Are grapes gathered from thorns, or figs from thistles? In the same way, every good tree bears good fruit, but the bad tree bears bad fruit. A good tree cannot bear bad fruit, nor can a bad tree bear good fruit. Every tree that does not bear good fruit is cut down and thrown into the fire. Thus you will know them by their fruits."
Even non-Christians like Russel Brand acknowledge this. The same goes for how we speak: our words reveal our hearts. Our words bear great weight, often more than we estimate, so we should be judicious, gracious, and careful with how we use them. Jim Brinkerhoff has a great sermon on this, which dives into Proverbs and of course the book of James. I'll leave you with that link and also, Jesus' words once more, found in Luke 6:45:
"The good person out of the good treasure of the heart produces good, and the evil person out of evil treasure produces evil; for it is out of the abundance of the heart that the mouth speaks."