Don’t count your chickens before they hatch
(sometimes just “Don’t count your chickens”)

Don’t make plans that depend on something good happening until it happens

e.g. my friend said he will give me a car so I’ve bought insurance for it. My brother told me I shouldn’t count my chickens before they hatch.