Take these steps to prevent most clogs and nasty backups. You'll thank us later.
How to Keep Drains From Clogging

Don't Wait for a Mainline Blockage
If you have a clogged sewer line every year or two, don't just keep getting it cleaned. Most sewer service companies will 'scope' the line to see what's causing the problem. That entails sending a remote camera down the line for a visual inspection.
The recurring issue could be tree roots entering through clay tile joints, a partially collapsed pipe or even rotted-out cast iron that allows soil to fall into the line and create a blockage. It's worth paying to find out the cause and get it fixed rather than hassling with frequent sewer backups and sewer-cleaning bills.

Install a Lint Catcher on Your Washing Machine Hose
If the drain for your washing machine hasn't ever backed up, you're lucky. Lint, bits of fabric, facial tissue and even the occasional sock can sneak through your washer's drain hose and cause trouble in your drain.
To keep this stuff from plugging your drain, put a lint trap on the end of the drain hose. You can buy mesh lint traps for your washer's discharge hose at home centers and hardware stores, or you can simply use an old nylon stocking. Use a zip tie to hold the lint trap in place. Keep an eye on the trap and replace it when it's full. For extra insurance, buy a Lint Trapper by Sioux Chief (shown above). This reusable cone-shaped trap snaps into your laundry tub drain hole. It's available online and at some home centers and hardware stores. Washer not draining? Try this quick fix!

Put Bacteria to Work

Collect Grease — Don't Dump It

Don't Rinse Cement, Grout or Joint Compound Down the Drain
Setting-type joint compound hardens by a chemical reaction and will set up even under water, so obviously if it settles in your drain you're in for a rock-hard clog. Sand is another building product that is notoriously bad for drains. Sand is heavy and settles quickly in traps and pipes to form clogs that are difficult to remove.
To avoid these problems, never rinse setting compound, grout, mortar mix or concrete down the drain. Instead, save rinse water in a container until the solid materials settle out. Then decant the water in an out-of-the-way area in your yard, and dump the remaining sludge into your garbage can. Need to remove a concrete stain? We have you covered.

Catch Hair Before it Reaches the Drain
Hair and soap combine in your tub or shower drain to create clogs that could end up requiring a drain snake to remove. But you can avoid that task by catching the hair before it reaches the drain.
Need to clear a clogged bathtub drain? Learn how here.
Various sizes of mesh screens are available for this purpose. Another option is to replace the stopper assembly with one that includes a built-in screen. One choice is the DrainEASY Bathtub Stopper, shown here. It's designed to replace stopper assemblies that screw into the drain.

Pop-Up Stopper

Collect Your Food Waste
Grinding up food in a disposer and sending it down the drain is convenient, but it can clog drains. A better idea is to collect your organic waste in a container and add it to a compost pile. Many cities collect organic waste for composting, but if yours doesn't, consider building your own compost bin. Avoid putting meat or other greasy food in the compost bin because it takes too long to break down.

Flush Your Drains
Low-flow toilets and faucets are great for saving water but not so good for keeping drains clear. The lower volume of water often doesn't carry away debris, and instead leaves it to collect in your pipes. You can counteract this problem by occasionally flushing the pipes with a large flow of water. Fill a five-gallon bucket with water and pour it into your toilet while simultaneously flushing to help keep the large main drain line clear. Also, fill your bathtub and sinks with hot water and release it down the drain.

Don't Use the Toilet as a Wastebasket
It's tempting to throw all kinds of personal care products into the toilet. After all, there's a big drain hole and the stuff usually goes down OK. But just because dental floss goes down the toilet drain doesn't mean it'll make it to the main sewer. It's possible it will get snagged on something in your pipes and start a clog.
In addition to the fact that many of these products don't decompose readily, adding an unnecessary burden to the water treatment facility, they can clog drains. So avoid using the toilet as a wastebasket. It's better for the environment and better for your drains.