To bite one's tongue / To hold back what you want to say
Describes stopping yourself from saying something you want to say, usually to avoid conflict or because it would be inappropriate.
I had to bite my tongue to stop myself saying what I thought.
Sometimes it's better to bite your tongue.
—Did you say something to him? —No, I bit my tongue.