"The prudent see danger and take refuge, but the simple keep going and suffer for it." Proverbs 27:12
It wasn't raining when Noah built the Ark. But Noah and his family survived the flood by building the Ark and stocking it in obedience to God (Genesis 6:11-22).
God led Joseph to use the years of plenty to store up sufficient grain to feed his people through the seven-year famine (Genesis 41:33-36).