I am trying to look for similar idioms to "some things are better left unsaid", because there's already an idiom that has this meaning, I suppose there are at least a couple others that have similar meanings. It doesn't have to be an idiom and can be a slang phrase or something that flows well in a casual, informal conversation.
Some things are better left unsaid does the best job on its own.
But a related idiom, in particular if you're talking about keeping a certain secret, is loose lips sink ships:
Loose lips sink ships is an American English idiom meaning "beware of unguarded talk". The phrase originated on propaganda posters during World War II. The phrase was created by the War Advertising Council and used on posters by the United States Office of War Information.
Per a comment, a UK version of this is careless talk costs lives.