If you’re buying a home, the last thing you want is an expensive surprise.

Unfortunately, most of things that can go wrong with a house tend to pack a powerful punch in the wallet.

If you have to replace your hot water heater, expect to spend upwards of $600. If you have to replace your furnace or central air conditioner, you could spend twice that or more. Even seemingly small problems, like burst pipes, badly-wired outlet, or cracked paint can cause a slow leak in your financial stability.

And since home buyers typically spend just about every penny they have buying the house, but often fail to plan for even the regular and ordinary expenses associated with owning and maintaining a home, these kinds of surprises can weak havoc on a budget.

Which is why it’s so important for home buyers to have a professional home inspector do an inspection of the house from top to bottom, including all mechanical systems.

But having a home inspector find things that are wrong with your house won’t matter if you don’t include a home inspection contingency as part of your contract.

An inspection contingency is an addendum to a contract that gives buyers the right to have a professional house inspector or other third party examine the property within a certain period of time after the agreement to purchase has been signed.

The point of the contingency is to protect you from purchasing a home that may have serious structural problems or material defects that aren’t plainly visible. If you have a home inspection contingency in your contract and find something terribly wrong with the home, you can walk away from the deal.

For sellers, home inspection contingencies are a stress-inducing (“Will my house pass inspection?”) but necessary part of the home selling process.

A proper home inspection takes 2 to 4 hours, depending on the size of the property and the complexity of any issues that are uncovered. In addition to a regular home inspection, you might choose to add other inspections to the inspection contingency, including:

-Radon. An odorless substance that rises from the ground, radon has been shown to have negative effects on the development and growth of children. You can get rid of radon by opening a basement window or introducing a ventilation system that allows fresh air to circulate, but you need to know if it is there.

-Asbestos. Asbestos is a hazardous material that was frequently used as a fire retardant and as pipe insulation. But asbestos can cause lung cancer and it is expensive and difficult to remove.

-Lead. Sellers are required to disclose to buyers if they have lead paint in their house. There are inexpensive swipe tests that you can do to see if there is lead in the paint or water. Or, you can hire a lead inspector to provide a full report.

-Toxic Substances. If the property is located near a gas station, dry cleaners, dump or other waste disposal facility, you may wish to have a specialist take soil samples to determine if your property is contaminated by any toxic substances. You can also send a sample of the water to a laboratory.

-Structural engineer. If the property has a crack in the foundation wider than 1/8″, or if the doorways are misaligned, you may wish to hire a structural engineer to determine if the property has severe, moderate, or normal structural issues. This type of inspection is increasingly common in places like earthquake-prone Southern California, although you may wish to hire one if you are uneasy about the structural integrity of the home.

-Pests. Worried about uninvited guests? You can hire an inspector who specializes in pests, including termites, mice, rats, roaches, carpenter ants, chipmunks, and other things you’d rather not have in your living space.

Your contingency must be in writing, and it must allow you to cancel your deal and get your good faith deposit back, if the property fails to pass inspection.

Don’t think that your inspection contingency gives you a free pass to cancel the deal for any reason. All houses (even newly-built ones) will have some minor issues. Canceling the deal without allowing the seller to attempt to fix the problem (or reduce the purchase price) isn’t a very nice thing to do.