Power outages are frustrating enough. Add in a generator catastrophe, and, well ... boom.

Portable generators provide a convenient backup supply of electricity when the grid goes down. But use one incorrectly, and the hazards are high. Among them are carbon monoxide poisoning, electrical shocks and electrocution, and fires.

Any one of these can lead to death. But carbon monoxide exposure may be your biggest enemy. According to data from the Consumer Product Safety Commission, more than 900 people died from carbon monoxide poisoning from portable generators between 2005 and 2017, and an estimated 15,400 people required emergency-room visits.

Yes, it’s grim. But newer portable generators are being designed with built-in sensors to prevent carbon monoxide tragedies. When dangerous levels are detected, an automatic shutdown is triggered.

In even better news, no matter what model you own, there are some basic safety tips you can, and should, practice to avoid all generator hazards. Here’s how to use your generator safely:

Never use a generator indoors.

There’s a reason carbon monoxide is often called the “silent killer.” The poisonous gas is colorless, odorless, and tasteless, making it easy to build up inside your home without warning. And as a byproduct of generators, this means you should never use your generator indoors, or in any enclosed spaces, including garages, crawl spaces, and basements. Opening doors and windows and using fans do not make it safe.

Always place your generator at least 20 feet from your home, positioned away from all doors, windows, and vents. Make sure there is at least three to four feet of clear space on all sides and above the generator to ensure adequate ventilation, advises the Occupational Safety and Health Administration (OSHA).

Then, as a precautionary step, the American Red Cross encourages you to install carbon monoxide alarms on every level of your home and in any outside sleeping areas. These are designed to provide early warnings of potential gas accumulation.

Wait until the storm is over.

If it’s raining outside, keep your generator powered off. Both the generator and your hands should be dry when operating to avoid electrocution. To help keep the area dry and ventilated, create a “canopy-like structure” over the generator, says the American Red Cross, using a tarp held up by poles. You can also find manufactured generator coverings online, from brands like GenTent and IGAN.

Use a transfer switch.

Hire an electrician to install a transfer switch, a heavy-duty cable that connects the generator to your circuit panel. This allows you to power devices without the use of extension cords, and minimizes the likelihood of your electronics frying. It also enhances safety. A properly installed transfer switch decreases risk of electrical shock, power overloading, and fires. It also keeps others safe. Plugging the generator straight into a wall outlet is known as “backfeeding,” which, according to OSHA, can energize wiring systems across great distances and put utility workers, your neighbors, and your household at risk of electrocution.

Quality extension cords matter.

If you plan to plug an electrical appliance directly into the generator, use a heavy-duty, outdoor-rated extension cord. Choose one that’s rated (in watts or amps) at least equal to the sum of the connected appliance loads, says the American Red Cross. Never use a cord that’s cut, frayed, or otherwise damaged. And avoid overloading the generator, which can lead to overheating, creating a fire hazard and/or generator failure. You may need to stagger when you’re using various appliances. (Not sure what size generator to purchase? Check out the American Red Cross’s sizing guide here.)

Cool, then refuel.

Generators build up heat while running. Accidentally spill generator fuel, like gasoline or kerosene, onto the engine, and it’s easy for a fire to ignite. Before refueling, always shut down the generator first, and allow it to cool. Check the generator’s label or instructions to see what type of fuel to use.

Think about how you’re storing your fuel.

Just as you don’t want your generator indoors, you don’t want your fuel inside either. Store fuel in an approved safety can in a shed or other protected area, away from fuel-burning appliances. That, of course, means you should store it away from your generator.

Take it for a test run.

Before an emergency, try out your generator to make sure it’s operating smoothly. Likely you’ll be in a calmer state at this point should something need to be adjusted or fixed. One thing to consider: Is there a power overload? Some machines draw three times more power in their first few seconds of startup.