You'd better be on time if you know what's good for you.If you know what's good for you, you'll call and apologize.
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 one knows what's good for one
Fig. one had better do what is expected of one. You'd better be on time if you know what's good for you.If you know what's good for you, you'll call and apologize.