1. Scrub out the washer tub

Bad smells can come from a variety of places in your washer, so you’ll want to start by cleaning the main part of the machine: the washer tub.

“Scrubbing your tub is a great way to deep-clean your washing machine and ensure there’s no soap scum left behind,” says Ron Shimek, president of Mr. Appliance.

“To get the most out of this method, pour a quart of white vinegar into the washer tub with 1 cup of baking soda, and use a stiff nylon brush to scrub the interior,” says Shimek. “Then run a wash cycle on the hottest temperature and heaviest laundry load settings.”

2. Clean the gasket

After you’ve deep-cleaned the entire inside of your washing machine, it’s time to tackle the gasket. If you have a front-loading machine, this step is especially important.

“The problem is that water and detergent get left in the detergent dispenser and the gasket sealing the door,” says Elyse Moody, kitchen expert at Designer Appliances. “This isn’t as much of a problem with top-load machines because gravity pulls the water down, so it doesn’t build up the same way. But in front loaders, the lingering water and detergent attracts bacteria and creates an environment where stinky mildew can grow.”

Apply vinegar to a paper towel and wipe down the inside of your gasket to kill any buildup that might be causing bad smells.

3. Sanitize your washing machine with bleach

https://imasdk.googleapis.com/js/core/bridge3.478.2_en.html#goog_963701780Volume 0%This ad will end in 12 3. Sanitize your washing machine with bleach

For persistent smells that just won’t quit (even after trying the first two tips), you’ll want to move to something more extreme: sanitizing the entire washer with bleach, or completing a vinegar-soak cycle. The process is similar for both products, but we recommend starting with vinegar as it’s less toxic.

“Cleaning your washing machine with vinegar is the best and safest way to eliminate any lingering smells from your appliance,” says Shimek. “All you need to do is run an empty cycle under the Clean setting with hot water, add 2 cups of white vinegar, and half-cup of baking soda to remove the smell, and let your washer run through the cycle.”

If afterward you’re still tempted to try bleach, be sure to allow enough time between cycles for the machine to dry out completely. Then set the empty machine on a normal wash cycle with hot water, and fill it up completely before adding a half-cup bleach to the detergent compartment.

4. Maintain a smell-free machine

While these cleaning tips will likely keep your machine odor-free for the near future, it isn’t a guarantee odor won’t return. For a long-term, smell-free solution, you’ll need to get in the habit of doing regular cleaning sessions, and practicing these clean-machine habits.

Don’t use too much detergent: Believe it or not, dumping in a little extra detergent to your loads can lead to an even stinkier washing machine.

“Using too much detergent when you wash causes the stinky buildup to accumulate even faster,” says Moody.

“Here’s an experiment I heard about recently. Take a clean sock, put it in a jar or bottle, add water, and shake it up,” adds Moody. “If you see suds, you’re using too much laundry detergent.”

Leave the washer door open between cycles: Regardless of what kind of machine you have (top- or front-loading), it’s a good idea to get in the habit of leaving your machine door open between cycles.

By allowing the drum of the machine to dry out completely, you’ll already be doing a lot to prevent any mold or bacteria from building up again.

Give everything a regular wipe-down: Get in the habit of wiping down the entire inside of your machine every few months to keep the stink at bay. Vinegar and paper towels will work well to kill any nasties that have started growing in the interim.

Remove clean clothes right away: This one is more for your clothes, but can also be helpful when you have a stinky washing machine to contend with. Again, moisture buildup leads to mold—so anything you can do to keep your machine from being left to fester in damp conditions will go a long way in beating the stink. It will also make your clean clothes smell a lot better.