bite your tongue
US /baɪt jʊər tʌŋ/
UK /baɪt jʊər tʌŋ/

1.
to make a conscious effort to avoid saying something that you want to say, often because it would be inappropriate or cause trouble
:
•
I had to bite my tongue to keep from telling him what I really thought.
•
She wanted to argue, but decided to bite her tongue.