Parshas Kedoshim · Passuk 19:17
Chabad.org — English translation + Rashi
Torah Temimah on Vayikra 19:17 · Yevamos 65b
You shall surely rebuke — Rabbi Ila said in the name of Rabbi Elazar son of Rabbi Shimon: Just as it is a mitzvah to say a word that will be heard, so it is a mitzvah not to say a word that will not be heard.
Classical derasha (TT)
Rebuke is obligatory only where it can still function as rebuke, not empty words.