Valmiki Ramayana Aranya Kanda Sarga 24 Shloka 11
Original Shlokaअनागतविधानं तु कर्तव्यं शुभमिच्छता। आपदं शङ्कमानेन पुरुषेण विपश्चिता।।3.24.11।।
1 source checked for this shloka
आपदम् danger, शङ्कमानेन by a person apprehending, शुभम् good, इच्छता by one desirous of, विपश्चिता by a learned one, पुरुषेण by a man, अनागतविधानम् defence before the onset of danger, कर्तव्यं हि should be planned.
A wise man who apprehends danger or one who desires his own good should plan his defence even before the onset of danger.