ばよかった details
Examples
should have — regret over one's own missed action
もっと早く寝ればよかった。
motto hayaku nereba yokatta.
I should have gone to bed earlier. casual
あの時、素直に謝ればよかったと思います。
ano toki, sunao ni ayamareba yokatta to omoimasu.
I think I should have just apologized honestly back then. neutral
you should have — reproaching another's missed chance, typically with のに
困ってたなら、言ってくれればよかったのに。
komatteta nara, itte kurereba yokatta noni.
If you were struggling, you could have just told me. casual
Formation
V conditional ば-form + よかった (いけばよかった)attaches to ば conditional stem
Notes
Related patterns
Similar
たほうがいい recommends while the choice is still open and can still be followed; ばよかった is the same advice arriving too late — the speaker regrets not having taken it.
Lookalikes
The same ば opening misleads — ば opens a live condition whose outcome is still undecided, while ばよかった is a frozen backward-looking idiom that admits no result clause after it.