〜てよかった says that you are glad or relieved about something that really happened or that you really did: 日本に来てよかった = 'I'm glad I came to Japan.' よかった is the past form of いい, and the て-form before it gives the reason for the good feeling. With 〜なくてよかった, you are glad that something did not happen.
§1Structure
Verb て-form + よかった (来てよかった). Negative: verb 〜なくて + よかった (降らなくてよかった). い-adjective 〜くて + よかった (天気がよくてよかった). な-adjective / noun + で + よかった (簡単でよかった, 軽いかぜでよかった). Polite: 〜てよかったです. With ね, it shows that you share the other person's relief: 〜てよかったですね.
§2Examples
日本に来てよかったです。
にほんにきてよかったです。
I'm glad I came to Japan.
傘を持ってきてよかった。
かさをもってきてよかった。
I'm glad I brought an umbrella.
雨が降らなくてよかったですね。
あめがふらなくてよかったですね。
It's good that it didn't rain, isn't it?
試験が簡単でよかった。
しけんがかんたんでよかった。
I'm glad the exam was easy.
旅行の間、天気がよくてよかったですね。
りょこうのあいだ、てんきがよくてよかったですね。
It's good that the weather was nice during your trip, isn't it?
軽いかぜでよかったです。
かるいかぜでよかったです。
I'm glad it was only a slight cold.
このアパートに引っ越してよかったと思いますか。
このアパートにひっこしてよかったとおもいますか。
Do you think it was a good idea to move to this apartment?
財布が見つかってよかったですね。
さいふがみつかってよかったですね。
I'm glad your wallet was found.
§3Common mistakes
- Making the polite form with でした: ✗ 日本に来てよかったでした. よかった is already the past form of the い-adjective いい, so the polite form is よかった + です: ○ 日本に来てよかったです. Using the present いいです is also wrong for this meaning: 来ていいです means 'You may come' (permission).
- Putting the た-form or the dictionary form before よかった: ✗ 先生に聞いたよかった, ✗ 先生に聞くよかった. In this pattern, the part before よかった is a て-form: ○ 先生に聞いてよかった. Adjectives and nouns also need their て-form: ✗ 安いよかった → ○ 安くてよかった; ✗ 休みよかった → ○ 休みでよかった.
- Using 〜てよかった for something that did not happen. If you did not buy a ticket and now feel sorry, ✗ チケットを買ってよかった is the wrong message: it says you bought it and are glad. For regret about what you did not do, Japanese uses 〜ばよかった: チケットを買えばよかった.
§4How it's different from similar grammar
- 〜ばよかった (I wish I had ...)
- 〜てよかった is about something that really happened, and the speaker is glad: レストランを予約しておいてよかった (I'm glad I booked the restaurant; I did book it). 〜ばよかった (N3) is about something that did not happen, and the speaker feels regret: レストランを予約しておけばよかった (I wish I had booked the restaurant; I did not book it).
- 〜て + feeling word (〜てうれしい and so on)
- 〜てよかった is one case of the て-form of cause: the て-part is the reason, and よかった is the feeling. 〜てうれしい is only about the speaker's own happiness: 友だちに会えてうれしいです (I'm happy that I could meet my friend). 〜てよかった is a judgment that the result was good, so you can also say it about another person's good news, usually with ね: 友だちに会えてよかったですね (It's good that you could meet your friend, isn't it?).
§5How this shows up on the JLPT
In N4 grammar questions, the blank is usually the form before よかった: choose the て-form (相談して), not the た-form or the dictionary form. Short passages also test the difference between 〜てよかった (it happened; glad) and 〜ばよかった (it did not happen; regret), so check in the context whether the action was really done. In listening, 〜てよかったですね is a common reply to someone's good news.
§6Quick check (3 questions)
1. Choose the form that fits the blank: 先生に__よかったです。いいアドバイスをもらいました。
せんせいに__よかったです。いいアドバイスをもらいました。
2. Choose the ending that fits the story: きのうは早く家を出ました。道がとても混んでいましたが、会議に間に合いました。早く家を__。
きのうははやくいえをでました。みちがとてもこんでいましたが、かいぎにまにあいました。はやくいえを__。
3. What does this sentence tell you? 「パスポートをなくさなくてよかった。」
パスポートをなくさなくてよかった。