In Russian language there is a proverb "Пока гром не грянет, мужик не перекрестится".
Literal translation would be something like this: the peasant will not cross himself before it begins to thunder. It is said in situations when somebody has been delaying / putting off the required actions until it became too late and as a result they have to deal with a much bigger problem and usually in a rush.
For example, not doing regular maintenance of a machine which led to its break down and expensive repair and down time. Or, ignoring security vulnerabilities in a software system until somebody hacks it, after which it becomes an emergency situation and people are in a rush trying to fix it. Or, a student ignores and puts off regular assignments during the semester and when he gets a reminder from the professor that the deadline is tomorrow tries to complete all of them at once in a rush.
In general, choosing to react to emergencies (usually in a rush) instead of proactively trying to prevent emergencies (during normal "business as usual" operations).
I'd like to focus more on phrases that describe a situation when an action done early is much easier than an emergency fix after the disaster strikes.
Another similar Russian proverb would be "пока жареный петух в задницу не клюнет" with the literal translation "until a roasted rooster pecks you in the ass".
Is there an idiomatic expression / proverb in English language for these situations / attitude?