means that
keeping silent at the right moment can prevent unnecessary trouble or embarrassment.
same as
A closed mouth catches no flies.
She avoided an embarrassing dispute by refusing to pass on a rumor she had overheard. “A fly will not get into a closed mouth.”