No summer weekend is complete without an outdoor barbecue. But before you fire up the grill this season, you’ll want to give it a thorough cleaning and make sure it’s safe to use. After all, you don’t want a grimy, greasy grill ruining the flavor of your Kobe steaks — or, even worse, creating a fire hazard in your back yard.

Have an electric grill? You're in luck.

Because electric grills are ­almost always nonstick, they’re far simpler to clean than gas or charcoal grills. But the grill plates can still accumulate grease. Typically, you just have to wipe them down with a soft sponge full of soapy water and dry with paper towels. To remove burnt-on food or grime, though, let the water soak on the plates for at least 30 minutes before drying.

Don’t want to get your hands dirty? “A lot of electric grill parts are dishwasher safe,” says ­Derrick Riches, backyard chef ­and barbecue expert at ­ Check your grill owner’s manual to see whether your parts are okay to put in the dishwasher.

Cleaning a gas grill

Gas grills usually require more time to clean than charcoal grills, given that they tend to have more parts. For a deep clean, Riches says it’s best to disassemble the grill and clean it piece by piece.

Most parts can be wiped clean with warm, soapy water. “You’ll want to avoid using cleaning products with corrosive chemicals,” Riches cautions. “Oven cleaners are particularly bad for grills.”

Grates require special attention. To rid them of dirt and grime — and ensure great-tasting food every time you grill — you’ll have to tailor your cleaning method to the type of grate you have.

Robert Hawkins, a gas grills product manager at Char-Broil, recommends these three approaches:

Porcelain-coated grates: Do not use metal or wire brushes when cleaning porcelain grates, because they can create chips or scrapes in the porcelain. Instead, start by burning off any leftover food. Once the grates have cooled, use a soft-bristle or nylon grill brush.

Cast iron grates: First, burn off any leftover food. Then use a nylon cleaning brush once the grates have cooled. Finally, lightly coat the grates with cooking oil.

Stainless-steel grates: Cover the top of stainless-steel grates with heavy-duty aluminum foil and then heat the grates on high for 10 to 15 minutes. “The aluminum foil redirects the heat to the grates, simply burning off leftover food,” Hawkins says. Clean the grates with a nylon cleaning brush once they’ve cooled.

If you’re still dealing with stuck-on food, Hawkins advises soaking the grates overnight in a mixture of two cups of vinegar and one cup of baking soda in a large garbage bag closed with a rubber band. “The next morning, you should be able to rinse off most of the stuck-on food with water,” he says. “Anything left over should come off easily with a nylon brush.”

Cleaning a charcoal grill

Because charcoal grills have fewer parts, they’re generally easier to clean than gas grills, but they still require some TLC.

Although lids on most charcoal grills can’t peel because they’re coated with porcelain enamel, occasionally you may see small pieces of debris on the inside of the lid that look like peeling paint. These pieces are nontoxic, but you should remove them ­using a soft stainless-steel brush. “If you don’t clean them, the pieces can flake off and fall onto your food,” Riches says.

If possible, remove the grill grate and clean it with a grill brush or other coarse cleaning brush. This should scrape away any leftover food and grease, Riches says. Next, collect debris from the bottom of the grill; if there’s an ash catcher, empty it. For a shiny finish, wipe down the grill lid with a mild detergent soap or glass cleaner.

Getting rid of rust

Stainless steel is resistant to corrosion, but it can still rust. Hawkins recommends using one of these three cleaning methods:

●Mix lemon juice with a powder detergent and water until it forms a paste. Apply the paste on the rust and let it sit overnight. Scrub it clean with warm water and a soft cloth or sponge.

●If the rust is on a part that can be easily removed, soak the part in soda overnight, rinse with ­water, and scrub the area clean with a soft cloth or sponge. (Soda contains phosphoric acid that is a main ingredient in many ­rust-removal products.)

●For stubborn rust stains, use a commercial rust remover and ­follow the directions on the ­package.

One caveat: “If you have a serious rust issue, you may have to look at replacing parts,” Riches says.

Safety measures

To make sure all burners are working properly on gas grills, “you should see an even blue flame across the burners when you fire up the grill,” Riches says. If the flame is not even — or you’re having problems lighting the grill — it could be because of a clogged ignition port, in which case you’d want to clean each port with a wire or a safety pin. (If you’re still having issues, it may be time to replace some of the burners.)

Damaged hoses or connection points can present fire risks. To ensure yours are in good condition, clean them with warm, soapy water and then turn on the grill. “If bubbles form, you have a leak, and the hose may have to be replaced,” Riches says.

Also, check the expiration date on your fire extinguisher. Fire extinguishers can last anywhere from five to 15 years, Hawkins says. If there’s no expiration date, check the extinguisher before grilling to ensure the pressure gauge is in the green. And make sure there are no cracks in the hose or nozzle and the locking pin is in place, he says.

Planning to use last year’s propane? You should be okay. “Propane doesn’t break down over time,” Riches says. “It should remain stable for about 30 years.”

The best way to extend the life span of your grill — and prevent unwanted flare-ups — is to clean your gas or charcoal grill after each use. By being diligent, you’ll save yourself the hassle of having to do another deep clean in the future.

More from Lifestyle: