“It’s a good thing we remembered to close the windows! It started raining while we were out.”

We say “it’s a good thing” when we are glad something happened because it led to positive consequences or avoided negative consequences. You could just say “I’m glad we remembered to close the windows” as well.

「窓閉めておいてよかった!出かけてる間に雨降ってきた。」

いい結果に繋がったもしくは悪いことを避けることができてよかったと思うときに「it’s a good thing」を使います。「I’m glad」と似ていて、どちらでも使えます。