Giving advice with 〜た+方がいい
Grammar: Necessity » 〜た+方がいい
When attached to the た form of a verb, 方がいい means that something else would be better (to do). It is similar in meaning to the English “had better do”.
Usage Notes
〜た方がいい gives advice by comparing the suggested action against another option and leaving the other option unsaid. Tone and sentence-final particles decide whether it sounds gentle or firm.
よ makes it more forceful. ね makes it softer or confirmatory.
Alternate Explanations
The た form of a verb, followed by the phrase 方がいい, is used to give advice. It corresponds to the English ‘had better do’. The sentence-final particles ね and よ are frequently used when giving advice, either to soften a suggestion (ね) or to give force to it (よ).
Kamiya, Taeko. “Commands, Requests, Suggestions, Approval, Disapproval, Prohibition, and Obligation.” Japanese Sentence Patterns for Effective Communication, Kodansha, 2005, p. 170
This pattern shows how to give advice, make a suggestion. This is done with the phrase 方がいい preceded by a verb in the plain past tense. 方がいい literally means ‘alternative is good’. The alternative being suggested is obviously the one expressed by this phrase, but the other alternative often remains unspoken. The unspoken alternative is often simply taking no action at all. The subject of this pattern is 方 (marked by が), and the topic is the person to whom the advice is being directed (marked by は); since this person is often ‘you’ or ‘I’, it is frequently omitted as being understood form context.
Chino, Naoko. “Basic Pattern 40.” A Dictionary of Basic Japanese Sentence Patterns, Kodansha, 2000, p. 233
Examples
Better to do light stretches before swimming with 〜た+方がいい
Grammar Explanation: Giving advice with 〜た+方がいい

Before Cocoa teaches Rize how to swim, Syaro stops her with a suggestion.
- シャロ:
- 「泳ぐなら念のため軽くストレッチした方がいいと思うの」
- “If you're going to swim, I think you had better do some light stretching just in case.”
- ココア:
- 「さすがシャロちゃん」
- “That's Syaro for you.”
Better to give up fortune telling with 〜た+方がいい
Grammar Explanation: Giving advice with 〜た+方がいい

Cocoa did fortune telling for her friends, only for all their fortunes to happen to her in a bad way.
- チノ:
- 「ココアさんは人の不幸の身代わりになる才能があるんですか?」
- “Cocoa, do you have a talent for taking on other people's misfortune?”
- リゼ:
- 「今後占いやめた方がいいぞ自分のために」
- “For your own sake, you had better stop fortune telling from now on.”
- ココア:
- 「なんで!?」
- “Why!?”
Better to re-learn how to swim with 〜た+方がいい
Grammar Explanation: Giving advice with 〜た+方がいい

Rize and her friends visit an indoor hot spring. Rize admits she doesn’t know how to swim.
- ココア:
- 「私のクロール見てー」
- “Look at my front crawl!”
- シャロ:
- 「泳ぎ方を覚え直した方がいいわね」
- “You had better relearn how to swim.”