hope for the best but expect the worst
To have hope that a positive occurrence will happen, while simultaneously readying for a negative outcome. Now that our house is on the market, there's not much we can do besides hope for the best but expect the worst. We hoped for the best but expected the worst when we learned that the hurricane was to make landfall.