if (one) knows what's good for (one)
If one wants to avoid trouble (one will do or avoid a certain thing). Oh, you'll be on time for the meeting, if you know what's good for you. If he knows what's good for him, he'll stop calling me that.
if you know what's good for you
Fig. if you know what will be to your benefit; if you know what will keep you out of trouble. Mary: I see that Jane has put a big dent in her car. Sue: You'll keep quiet about that if you know what's good for you. Sally: My teacher told me I had better improve my spelling. Bill: If you know what's good for you, you'd better do it too.