if knows what's good for

if somebody knows what's good for them

if you say that someone will do something if they know what's good for them, you mean that they should do that thing or else something bad might happen to them You'll obey my orders if you know what's good for you.
See also: good, if, know
Idioms browser ?