ת"ר (ויקרא יט, טו) בצדק תשפוט עמיתך שלא יהא אחד יושב ואחד עומד אחד מדבר כל צרכו ואחד אומר לו קצר דבריך ד"א בצדק תשפוט עמיתך הוי דן את חבירך לכף זכות הוי דן את חבירך לכף זכות. ואל תכריעהו לכף חובה. הוי שש בחלקך. והתנאה במיעוטך. ואל תשנא את :המוכיחך. יהי חלקך מבורך לעולם. עין טובה ונפש שביעה ,וֶהֱוֵי דָן אֶת כָל הָָאדָם לְכַף זְכּות. בשעה שעל האדם לקבוע את עמדתו כלפי זולתו וכלפי התנהגותו ראוי שישקול את כלל הנתונים אלה לעומת אלה כבמאזניים (ראו להלן ב, יב), את חובותיו של האדם מכאן ואת זכויותיו .מכאן, וישתדל להטות את כף הזכות כדי שזו תכריע ...והוי דן את כל האדם לכף זכות. ענינו כשיהיה אדם שלא תדע בו אם צדיק הוא אם רשע ותראהו שיעשה מעשה או יאמר דבר שאם תפרשהו על דרך אחת יהיה טוב ואם תפרשהו על דרך אחרת יהיה רע קח אותו על ...הטוב ולא תחשוב בו רע וֶהֱוֵי דָן אֶת ּכָל הָָאדָם לְכַף זְכּות. ּכְׁשֶהַּדָבָר ּבְכַף מֹאזְנַיִם וְאֵין לֹו הֶכְרֵעַ לְכָאן ּולְכָאן, ּכְגֹון ָאדָם ׁשֶאֵין ָאנּו יֹודְעִים מִּמַעֲׂשָיו אִם צַּדִיק אִם רָׁשָע וְעָׂשָה מַעֲׂשֶה ׁשֶאֶפְׁשָר לְדּונֹו לִזְכּות וְאֶפְׁשָר לְדּונֹו לְחֹובָה, מִּדַת חֲסִידּות הִיא לְדּונֹו לְכַף ,).זְכּות. אֲבָל ָאדָם ׁשֶהֻחְזַק ּבְרָׁשָע, מֻּתָר לְדּונֹו לְחֹובָה, ׁשֶֹּלא ָאמְרּו אֶּלָא הַחֹוׁשֵד ּבִכְׁשֵרִים לֹוקֶה ּבְגּופֹו (שבת צז :מִּכְלָל ׁשֶהַחֹוׁשֵד ּבִרְׁשָעִים אֵינֹו לֹוקֶה והוי דן את כל האדם לכף זכות :ומכ"ש לרבך וחבירך, שכשלא תדונם לכף זכות לא תרוויח מהם כלום
The Sages taught: The verse states: “But in righteousness shall you judge your colleague” (Leviticus 19:15), from which it is derived: The court must ensure that there will not be a situation where one litigant is sitting and one litigant is standing, or a situation where one litigant says everything that he needs to say to present his case and one litigant, the judge says to him: Curtail your statement. Alternatively, it is derived from the verse: “But in righteousness shall you judge your colleague,” that you should judge another favorably, and seek to find justification for his actions, even if when interpreted differently his actions could be judged unfavorably. Tractate Derekh Eretz Zuta 3:2 Judge your fellow in the scale of merit and do not turn the scale against him. Rejoice in your lot and enjoy the little you have. Hate not him who reproves you. Your lot will always be blessed if you possess a bountiful eye and a contented soul. Avigdor Shinan , English Explanation of Mishnah Judging every person with favor is perhaps some of the sagest advice the mishnah can give in teaching a person to succeed in society. One who is constantly skeptical of others’ actions and motives will certainly not be able to have the friends or teachers mentioned in the previous two clauses of the mishnah. We saw this ideal in Mishnah Sanhedrin when the Rabbis actually legislated that a court is obligated to search for means to exonerate the accused. Rambam Its subject is when there is a person whom you do not about him if he is righteous or if he is wicked and you see him doing an act or saying something and if you interpret it one way it will be good and if you interpret in another way it will be bad - [in this case,] take it to the good and do not think bad about it. But if the man is known to be famously righteous and of good deeds; and an action of his is seen that all of its aspects indicate that it is a bad deed and a person can only determine it to be good with great stretching and a distant possibility, it is fit that you take it that it is good, since there is some aspect of a possibility that it is good. And so [too] when it is an evildoer and his deeds are famous, and afterwords we see him that he does a deed, all of the indications about which are that it is good but there is an aspect of a distant possibility that it is bad; it is fit to guard oneself from him and not to believe that it is good, since there is a possibility for the bad. Bartenura "and judge every person as meritorious": when the matter is hanging in the balance and there is no way to decide it in this way or that way. For example, a man from whose actions we do not know if he is righteous or wicked, who preforms an act that is possible to judge favorably and possible to judge unfavorably, it is pious to judge him favorably. Rabbi Israel Lipschitz, Yachin We can extrapolate to this to the case of your friend and teacher from an argumentum a fortiori, since if one does not judge them favorably, then they will not gain from them at all