Just as it is a mitzvah to say something that will be heeded, so too it is a mitzvah not to say something that will not be heeded.

כשם שמצוה לומר דבר הנשמע כך מצוה שלא לומר דבר שאינו נשמע
Shiurim in this topic
1519. Encouragement to Guide One's Son in Chassidus and Yiras Shamayim עידוד להדריך את הבן בחסידות וביראת שמים