A phrase used to recommend or advise that someone ought to do something; a soft way to say 'had better' or 'should'.
寝る前にパソコンの電源を切った方がいいよ。
You'd better turn off your computer before going to bed.
雨が降りそうだから傘を持って行った方がいい。
It looks like rain, so you should take an umbrella.
その問題は早めに先生に相談した方がいいです。
You should consult the teacher about that problem early.
タバコはやめた方がいい。
You'd better quit smoking.