At common law: the contract is automatically brought to an end at the time of the frustrating event. The relevant statute is the Law Reform (Frustrated Contracts) Act 1943. It only applies where there’s no express provision in the contract for what happens if it’s frustrated.
The key provisions are:
If some sort of pre-payment or deposit has been made, the buyer can get that pre-payment back, minus any expenses incurred by the seller.
If some sort of pre-payment or deposit has been made, the buyer can get that pre-payment back, minus any expenses incurred by the seller.
If the contract has already been partly performed, it’s a bit more complicated. You have to pay for any benefit you’ve already received. Suppose the contract is for a complete garden makeover, and at the time of the frustrating event, the contractor has already installed a swimming pool in your garden. You have to compensate the gardener for the expenses he’s incurred in installing your pool.