Whenever the fancy takes (one) phrase
Whenever one has a desire, wish, or inclination to do something.
With this card, you can withdraw money whenever the fancy takes you, and you won't be charged any cost.
He built a swimming pool in his backyard so that he can swim whenever the fancy takes him.
I would like to rent a self-catering villa on my next vacation because I can cook and eat whenever the fancy takes me.
The origin of this phrase is not clear.
To keep optimistic or have hope that something positive will occur and simultaneously prepare for a negative outcome
All I can do is hoping for the best and preparing for the worst.