Don’t count your chickens before they’re hatched.
You should not assume that something will happen until it actually happens. It can be used for a variety of situations: spending money you cannot afford to spend because you expect to receive some money is one example.