François Fénelon said this quote

Silence promotes the presence of God, prevents many harsh and proud words, and suppresses many dangers in the way of ridiculing or harshly judging our neighbors ... If you are faithful in keeping silence when it is not necessary to speak, God will preserve you from evil when it is right for you to talk.