There are four ways to conveying “if” in Japanese

MethodDescriptionExample
When one thing is a consequence of another夜になると、空気が冷たくなる
In storytelling, to mean “Upon (doing something)“朝起きると、妻はいなかった
If the condition is something that is consciously chosen, followed by といい, it’s a suggestion to do somethingわからないことがるときは、あの先生に聞くといいよ