But before loading up the generator’s circuits during an electrical outage, learn how to install and operate it safely—trust us, when you’re in crisis mode after the power goes out, figuring things out on the fly could lead to dangerous mistakes or serious accidents, including carbon monoxide poisoning, burns, and electric shock. From what type of generator you need to who should install your generator, we chatted with professionals to help you make the right choices while staying safe.

What Size Generator Do I Need?

First, decide which area of the home you want to power during an outage, suggests Jim Koether, a master electrician at Reliable Heat & Air in Kennesaw, Georgia. You can check out an online calculator or wattage chart to figure out what needs powering, or bring in a licensed professional. “We do an assessment of the home, and sometimes homeowners want the whole house to work, so we’ll calculate what they need,” says Koether.

Types of Generators

Units range from small, portable generators that can power a few personal devices to huge ones that run the whole house. Gasoline-powered conventional generators are large, loud, and able to power three or four rooms. Smaller inverter generators run on gasoline or liquid propane and can run your computer or one room’s worth of circuits. Both types require refueling after 8 to 10 hours. You’ll also have to decide whether you want a portable generator that you switch on when needed or a standby model that kicks in automatically. A portable generator works well for short power failures, but you have to take it outside, plug it in, start it up, and make sure you have plenty of gas, says Koether. If you live in an area with frequent outages or hurricanes, a home standby generator connected directly to a propane tank offers more reliable power over long periods. “If you’re not home when there’s a bad storm and the power goes out, a standby generator comes on automatically,” says Koether. “You won’t lose any food, the heating and air keep flowing through the home, and the alarm system and wired smoke detectors still work. There’s added security knowing you don’t have to do anything.” No matter which generator you choose, make sure it’s been approved by a nationally recognized testing laboratory, advises Daniel Majano, program manager at the Electrical Safety Foundation International (ESFI) in Arlington, Virginia. “It should say UL, Intertek ETL, or CSA, which means the device has been tested and as long as it’s operated correctly, it’s safe.”

How Much do Generators Cost?

Safety is never something you should skimp on, and a good-quality home generator doesn’t come cheap, says Koether. “Most people want to run a refrigerator or freezer, most of the lights in the home, and one heating system, and that starts at around $6,500,” he says. A mid-tier generator that can power up to a five-ton air conditioner, plus houses up to 3,000 square feet, costs about $8,500. Larger generators that run two air conditioners, all appliances and homes above 3,000 square feet cost around $12,000.

Where Should Generators be Installed?

To prevent carbon monoxide poisoning—which is extremely dangerous and even deadly—generators should be installed at least 20 feet away from your house, ideally on a concrete slab, says Majano. “About 80 percent of all carbon monoxide poisonings are caused by portable generators, usually during hurricane season or during the winter,” he explains. “Never operate a generator in an enclosed space, and make sure there are three to four feet of clearance from above and on the sides of the generator. Keep generators away from windows and front doors—anywhere smoke and carbon monoxide can accidentally leak into the home—and direct exhaust away from the house.” Some new portable generators have a built-in sensor that automatically shuts down the machine if it detects dangerous levels of carbon monoxide.

How to Safely Run a Generator

Sure, you can head to a big-box store and buy a generator right off the shelf. But for total peace of mind, it’s wise to consult an electrician to help you choose the right model and then be sure the unit is properly set up according to the building code and functioning for your space, says Koether. “We install it so it works safely, making sure the gas line is run properly and the wiring inside the home is done properly,” he says. “Also, every generator installed goes through a gas inspection, a site inspection and an electrical inspection by the county. We test the generator when the inspector is there.” If you live in an older home, it may not be able to handle the wiring, so pros recommend getting the breakers checked. Majano and Koether also shared these safety tips:

Use a heavy-duty, three-pronged extension cord rated for outdoor use to plug appliances directly into the generator, and make sure it’s the right size for what you want to power.Always use a ground fault circuit interrupter (GFCI). If it detects water coming in from either a plug or where the generator is, the GFCI will shut off the power and prevent electrocution.Install carbon monoxide detectors on every floor in your home, in case anything leaks in.Keep generators dry by installing an open, canopy-style shelter or a cover made for generators.If your generator is gas-powered and needs to be refueled, allow the machine to cool down completely first because gasoline can ignite on a hot machine.Store extra gasoline away from living areas.Keep children away from generators at all times.

How to Keep Your Generator in Safe Condition

Just like cars, generators need regular maintenance, says Majano, who suggests following the manufacturer’s instructions, which may advise checking the batteries and firing up the machine once a month to prevent moisture from accumulating in the electrical components. “If anything big occurs, contact the manufacturer or someone licensed within that field to repair the generator. We don’t recommend doing any repairs yourself,” he says. The Portable Generator Manufacturers’ Association offers helpful information about generator safety, and the ESFI has a comprehensive safety tip sheet and video so homeowners can power up before the next storm blows in.