"Had better" can be taken, appropriately, as a warning when a person of authority uses it with an equal or underling:
"¢ General: Private, you'd better clean this barracks up in five minutes!
Soldier: Yes, sir!
"¢ Teacher: Tommy, you'd better do your homework or you'll get a bad grade in this class.
Tommy: Yes, ma'am.
"¢ Father: Mindy, you'd better get home before twelve tonight or you'll be grounded for a month.
Daughter: OK, Dad.
"Had better" can also be taken as an advisory or a friendly warning, even to oneself:
"¢ Doctor: You'd better go on a diet. It's not healthy to be overweight.
Patient: OK. What should I do?
Forecaster: OK, viewers, you'd better stock up on flashlights and batteries. This storm will probably knock out the power.
"¢ Person: Hmm. I'd better not say anything to him. I don't want to hurt his feelings.
"Had better" is used with friends, family, colleagues in a cordial matter when one wants to give advice or indicate what is better for the listener:
"¢ Mary: Sally, you'd better call Jack. He's called you five times already.
"¢ John: You'd better be more careful, Harry, or they'll fire you.
"¢ Husband: You'd better stay home today, dear. You really aren't well. Call in sick.
A problem occurs when a person who is not in authority uses it with the person who has more authority:
"¢ Soldier: Sergeant, you'd better give me a weekend pass.
(Correction: Sergeant, Corporal Smith here, applying for a weekend pass.)
"¢ Student: Teacher, you'd better let class out early today!
(Correction: Teacher, could you please let class out early today?)
"¢ Son: Dad, you'd better give me the car tonight.
(Correction: Dad, could I please take the car tonight?)
"Had better" is close in meaning to "should." It is a little stronger, and does carry the connotation that if one doesn't do something, there will be a bad consequence.
It's true that one should be careful about using "had better" to avoid misunderstanding, as in the last group of sentences above. When in doubt, choose another construction.