When sewage backs up into the house or terrible odors overcome the backyard, you know something is wrong with your septic system. Depending on what’s causing the problem, you’ll face some big decisions about whether to repair or replace the equipment.

If it’s a broken pipe, patching it might cost just a few hundred dollars. But if the drainfield needs to be replaced, you could be out $2,000 to $10,000. Worst case: You need an alternative treatment system, for $15,000 or more.

First Steps in a Septic Emergency

Here’s how to handle problems when they arise.

If you find sewage in your house: Lift the lid of the septic tank and check the water level—or call a septic tank pumping company to do this for you. If the water is lower than the outlet, the pipe between the house and tank might be clogged. Call a plumber.

If the level is higher than the outlet, the problem is the tank or something beyond it. Have your tank pumped ($200 to $400), which gives you a little time to figure out what to do next and allows the pumper to see whether there’s an obvious problem, such as a clogged screen at the outlet.

If the drainfield is saturated because of flooding, however, wait to pump because emptying the tank may cause the tank to float, breaking the pipes. Take precautions as you clean up the mess in your house, so you don’t get sick.

If the drainfield stinks or is soggy: Keep people away from any standing water or soggy soil, which can be a biohazard. If you have young children or pets, you might need a temporary fence. Have your septic tank pumped, and cut back on water use. These steps should reduce the odor.

Drainfield Failures

But they aren’t long-term solutions. When a drainfield fails, it’s often because the septic tank wasn’t pumped often enough. Sludge and scum layers can grow so thick that there’s little space left for wastewater to pool while ingredients separate.

This lets grease and solids get into the drainfield and clog it, resulting in stinky water bubbling up to the surface. By the time you notice, the damage is done—and the drainfield needs replacement.

A drainfield can also fail when you haven’t done anything wrong. Over time—often 30 years or so, according to Craig Mains of the National Small Flows Clearinghouse, a non-profit that advises the septic system industry—beneficial microbes in the soil around the drainfield become so abundant that they literally clog the soil so it can’t properly absorb the water.

The only alternative if you have a plugged drainfield is to abandon it and build a new one. The good news is that once you have a replacement drainfield, you’ll never have this problem again. Eventually, the bacteria at the old site will die from lack of food, and will decompose. When the second field plugs someday, you can go back to using the first.

When to Repair the Problem

Some problems can be solved relatively easily. If there’s standing water or a sewage odor between the septic tank and the drainfield, it may be nothing more than a broken pipe, a roughly $600 repair. If you have an advanced treatment system, the maintenance company might need to adjust or replace a part.

If you have an aerobic treatment unit—one that aerates the tank to help break down the waste faster—and were away for a long period, the beneficial bacteria might have died off. You may just need to use your system frugally for a few weeks while the population rebounds.

When to Replace System Components

There’s usually no repair for a drainfield that has failed. You probably need to replace some or all of your system.

There are many ways to combine treatment and drainfield alternatives, and your decisions can have a huge impact on costs as well as on how much landscaping you need to redo and how you can use your property in the future. If you want to reserve land for a future garage, for example, you might be willing to spend more on a compact system.

Even if the drainfield is kaput, you may learn that the septic tank itself is okay. Reusing the tank can save you $1,000 or more—and keeps that part of your yard intact. But if moving the tank would solve a landscaping issue or make future pumping easier, now’s the time to do it.

Getting it Fixed

Check the websites of your local health department and state environmental agency to learn what procedures you need to follow for repairing or replacing a septic system—you may even find a list of licensed repair companies.

Call a couple and schedule visits. Or, if you have an advanced treatment system with an annual maintenance contract, call the company that’s overseeing your system already.

Paying for Septic Repairs

If you need major septic work, contact your local health department or environmental agency, which may be able to help you find affordable financing or provide tax credits for the work. Some municipalities use money received through the federal Clean Water Act to help finance septic system repairs by offering low-interest loans.