N4
ばよかった
Should have, I wish, It would have been better to
サービスエリアが一つもないじゃないか。高速に乗る前にトイレに行けばよかった。
There aren't any service stops, are there? I wish I had gone to the bathroom before we got on the highway.
Explanation
「〜ばよかった」 means 'I should have …' or 'it would have been better if …', regret about the past.
1Affirmative: you did not do it then, and regret it now: 「傘を持ってくればよかった」 (I should have brought an umbrella; I got wet).
2Negative 「〜なければよかった」: you did it, it turned out badly, and you blame yourself: 「あんなこと言わなければよかった」 (I wish I hadn't said that).
Mixed up with
In speech 「〜ばよかった」 and 「〜たらよかった」 are almost the same, both regret: 「来たらよかったのに」.
Endings: 「〜ばよかったなあ」 is a sigh to yourself; said to someone else, 「〜ばよかったのに」 often carries mild blame, like 'you could have just told me'.
It is only for a past that cannot be undone, never for a supposition about the future.