"You shall surely rebuke your friend." (Vayikra 19:17)
If you see someone doing something wrong, it is a mitzvah to explain, in a
gentle manner, how he is hurting himself. Keep in mind that your rebuke
should not inflict pain and should not be delivered out of hurt feelings.
Rather, you are trying to help the other person in order for him to gain
more reward in Olam HaBa (Rambam, Hilchos Dei'os 6:7).
The Gemara (Bava Metzia 31a) teaches that one should first improve himself
and then teach others. Rashi notes that one who shames a sinner when it
is not called for is himself commiting a sin. On the other hand, the
Gemara (Shabbos 55a) teaches that one who is able to protest but fails to
do so is consedered guilty for condoning the sin.