Would rather and had better are very much alike and therefore often confused. Let's see how to use them in sentences and what difference in meaning they have.
What is in common
Would rather and had better have three common features:
1) would rather / had better + infinitive
Both would rather and had better act like modal verbs, so the main verb that follows comes in the base form.
I would rather stay at home tonight. "stay" is in the infinitive form
You had better apply for that job. "apply" is in the infinitive form
2) would rather / had better + not + infinitive
To make a negative sentence, we add "not" before the main verb.
I would rather not answer this spam call. WRONG wouldn't rather answer
You had better not test the sharpness of the knife with your finger. WRONG hadn't better test
3) would/had → ‘d
We almost always contract would и had to 'd after pronouns, especially in spoken language.
We’d rather meet some other time. ‘d = would
He’d better listen to me. ‘d = had
Would rather and have better have a difference in meaning.
Would rather + infinitive = preference, choice
He would rather say nothing than argue. = He prefers saying nothing...
Would you rather go to the theatre or to the opera? = Do you prefer to go...
Had better + infinitive = strong advice, recommendation
It has the same meaning as "should". Mind that we're talking about the present or the future, but not about the past.
You had better call the shop before visiting it. = You should definitely call the shop...
They had better inform us before making a decision. = I really believe they should inform us...