In 39:11-18 we are told the story of how the wife of Potiphar tried to seduce Yosef into having an affair with her. he nearly succumbed, but resisted and escaped. She then claimed that he had tried to force himself on her, with strong circumstantial evidence, and Yosef ended up in jail.
Mrs. Potiphar's story was very convincing. There she is holding his clothes saying he had attacked her and when she screamed out he ran away. If you read such a report in the newspaper of amn attempted rape, you would surely have believed the story to be true. Any explanation the alleged rapist would offer would not even be entertained in your mind as possibly being true. You would say he is trying to confuse us to show his innocence and you would lock him away.
Yet we know that despite her elaborate explanation, the truth was really very different. And despite the truth, nobody believed Yosef, nobody even listened to Yosef, and he ended up in jail.
This story shows how important it is to be "dan l'kaf z'chus" - judge people favorably, giving them the benefit of the doubt. Even when Yosef looks 100% guilty, there is really a different explanation that was ignored. So even when someone looks guilty to you, and you inclined to consider him guilty, consider there might be another explanation to the events.