When do you use this exactly?
Sometimes you will see 다행하다 or 다행히 but sometimes you will see this word. The former is used as the adjective form. It is like "to be lucky" Whereas this is more to say that "a fortunate situation exists" or "something fortunate will arise"
날씨가 좋아서 다행이었다