The best time to mentally prepare yourself for times of adversity is when things are going well and you are in a resourceful state. Adversity is a challenge that enables you to develop attributes that wouldn't be developed in easier times. Keep building up the inner resources that will enable you to cope well with difficulties. If you are in the middle of a difficulty right now, then right now is the best time to build up those resources. You won't have to wait and see if the inner resources you need are becoming a part of you, you will see results right away.
Develop courage and confidence. Develop persistence and resilience. Develop optimism and hope. How can you develop these qualities? Visualize yourself mastering them. See, hear, and feel yourself being confident and courageous. See, hear, and feel yourself persisting and bouncing back. Right now feel an inner sense of optimism that you will cope well with difficulties. And if a difficulty arises that you don't cope with as well as you wished, learn from the experience to cope better next time.
(From Rabbi Pliskin's "Happiness",p.196-7)