好在 + [positive outcome clause]
The adverb 好在 (hǎozài) means "fortunately" or "luckily" and introduces a positive outcome that mitigates a negative situation. It typically appears at the beginning of a clause that follows a description of something bad. For example, 好在并未受到损坏 means "fortunately, no damage was done."
好在我带了伞,不然就被淋湿了。
hǎo zài wǒ dài le sǎn, bùrán jiù bèi lín shī le.
Luckily I brought an umbrella, otherwise I would have gotten soaked.
虽然迟到了,好在老师还没开始上课。
suīrán chídào le, hǎo zài lǎoshī hái méi kāishǐ shàngkè.
Although I was late, luckily the teacher hadn't started class yet.
路上堵车很严重,好在我们提前出发了。
lù shàng dǔchē hěn yánzhòng, hǎo zài wǒmen tíqián chūfā le.
The traffic jam was really bad, but luckily we left early.