don’t count your chickens before they hatch
you should not make plans that depend on something good happening before you know that it has actually happened:
She wanted to buy a dress in case someone asked her to the dance, but I told her not to count her chickens before they hatched.