[verb た-form] + ほうがいい [verb ない-form] + ほうがいい [noun] + の + ほうがいい
ほうがいい gives advice: "you should", "you'd better". For doing something, the verb goes in the た-form even though the advice is about the future; for not doing something, it goes in the ない-form.
The negative stays in the present: ない, never なかった.
A dictionary form before ほうがいい is possible, but it states what is better in general rather than telling someone what to do.
ほうがいい is practical advice: it will turn out better for you. べきだ says what is right, as a duty, and sounds much heavier.
These go beyond advice about an action.
Said straight to someone above you, ほうがいい can sound like a lecture. とおもいます思います after it makes it an opinion.
After a noun with の, ほうがいい picks one of two: "X is better".