As we have already discussed, there is a tendency to denigrate a fellow Jew whom we see transgressing, and thereby achieve a momentary “high.” On the other hand, the Torah has given us instructions on how to view a person we see transgress, so that we may judge him favorably and interpret his behavior in a more positive way.
The Chofetz Chaim says: If the subject is an “average” person, which means he generally guards himself from sin but does transgress occasionally, then we should attribute his lapse to one of three things: Either he did it accidentally (such as in the case of a storekeeper who gives you the wrong change), or he did not know it is forbidden (such as in the case of a person who transgressed a Shabbos law), or he mistakenly thought that this particular mitzvah is a midas chasidus, an act of piety reserved for people who want to be especially stringent.
This is what we should tell ourselves, even if we see the person transgress several times. We must judge him favorably and it is forbidden to feel animosity towards him because of what we have seen.
The halachah is different, however, when we are certain that the person knows that a particular act is forbidden, and we see him transgress purposely and with specific intent— for example, he walked into McDonald’s and ate a hamburger. If we know that such an act is out of character for this person and he probably did it only this one time and it was not done publicly (in the presence of other observant Jews), then it is forbidden to reveal this information. The Torah requires us to consider the possibility that the person has already engaged in teshuvah (repentance) and we will embarrass him unnecessarily by speaking about the incident.
However, we should approach the person privately and speak to him concerning his transgression. But the Chofetz Chaim cautions: make sure to speak gently and with respect. People are receptive to criticism only when they are treated with respect and shown genuine concern. Furthermore, the Torah cautions us not to rebuke in a hurtful or insulting way. We are commanded: “You shall surely reprove your fellow and do not bear a sin because of him” (Vayikra 19:17). The latter half of this verse teaches us that it is a serious sin to embarrass someone in public even while offering well-intentioned reproof.
All of the above concerns dealing with the average person. If the person we see transgressing is a talmid chacham (Torah scholar) then it would be a great sin to publicize his misdeed because he surely has repented.