临渴掘井

lín kě jué jǐng

lit. not to dig a well until one is thirsty

to be unprepared and seek help at the last minute (idiom)

lín

to face

thirsty

jué

to dig

jǐng

a well