expression
man turns to God only in times of trouble; there are no atheists in foxholes
Proverb expressing that people tend to seek divine help only when they are in distress, and forget about it once the trouble passes.
試験前になると急に神社に行くなんて、苦しい時の神頼みだね。
Going to a shrine only right before an exam is a classic case of 'man turns to God only in times of trouble,' isn't it?
彼は普段は無宗教なのに、病気になると祈り始める。まさに苦しい時の神頼みだ。
He's usually not religious, but when he gets sick he starts praying. That's exactly 'there are no atheists in foxholes.'
A Japanese proverb literally meaning 'relying on the gods in times of hardship.' The exact origin is uncertain, but it reflects a common human tendency observed across cultures.