Welcome to English Forums, Joey_five!
"had better" has no past form. For this reason you have to use the past of one of its equivalents.
You had better think about it is like
You would do better to think about it.
So the past can be expressed as
You would have done better to think about it.
You had better think about it is also like
It would be better for you to think about it.
So the past can also be expressed as
It would have been better for you to think about it.
The same principle applies to "would rather".
I would rather think about it is like
I would prefer to think about it.
So the past can be expressed as
I would have preferred to think about it.
CJ