expression
we'll cross that bridge when we get there; we'll think about it when the time comes
Idiomatic expression meaning to deal with a situation when it actually happens, rather than worrying about it in advance.
今から心配しても仕方ないよ。その時はその時だ。
There's no point worrying about it now. We'll cross that bridge when we get there.
試験に落ちたらどうしよう?まあ、その時はその時で考えよう。
What if I fail the exam? Well, let's think about it when the time comes.
Similar fatalistic nuance, but なるようになる is more about letting things take their natural course, while その時はその時 focuses on postponing worry until a specific future event.
A set phrase composed of その時 (that time) repeated with the topic particle は, literally 'that time is that time'. The exact origin is uncertain, but it is a natural Japanese expression that became idiomatic.