If your washing machine smells, don't panic. Smelly washing machines aren't always a sign that there's something terribly wrong, or that there is necessarily mould growth. Typically, unpleasant whiffs from your washing machine are simply due to detergent buildup and/or lack of ventilation.
There are two main ways to try and get rid of buildup in your washing machine: one is with an alkaline substance such as baking soda. Baking soda's high ph makes it perfect for cutting through greasy and oily stains, making it very effective in kitchens. However, if you live in a hard water area, you may have noticed that cleaning your washing machine with baking soda isn't doing a lot.
If that's the case, it's time to try the opposite – acidic – approach. Citric acid and ascorbic acid (commonly known as vitamin C) are reducing or chelating agents, which makes them particularly effective for cleaning buildup associated with hard water – rust, limescale, and soap scum or detergent buildup.
Bring a pan of water to the boil, take off the heat, and dissolve approximately 200 grams of ascorbic acid powder and 100 grams of citric acid powder in the water. Add the warm solution directly to the drum of your machine and pour a little into the tray. Run the machine on a hot wash without any clothes. Don't use citric acid undiluted on plastic washing machine trays as it could cause damage.