It just seems wrong that something we use to get our clothes clean can itself get mucky and smelly, but washing machines which are not regularly cleaned through can break down or start to deteriorate in performance, meaning your clothes come out dirtier than they go in. Cleaning your washing machine isn't a big job, and it's something we should all get into the routine of doing every month.
One of the biggest enemies of all electrical appliances which use water is limescale. If you live in a hard water area you'll be familiar with the furred up element in your kettle, and exactly the same will be happening inside your washing machine. To treat limescale in your washing machine you'll need to know a bit of basic chemistry. Think back to all of those experiments you did with acids and alkalis - limescale is an alkali substance and therefore you can remove it by using a weak acid in your machine to bring the pH back to neutral. There are loads of products on the market to get rid of limescale in your washing machine, some which you add in to every wash, and others which you use in a separate cycle to clean the machine. These products can be expensive though, and a large cup of either white vinegar or lemon juice can be used instead. Pour the lemon juice or vinegar into the soap dispenser drawer and run the machine through the cycle while empty of clothes.
However efficient your machine, if you pour powder or liquid into the detergent drawer at the start of each cycle, it can soon become full of smell sludge which gets into all of the crevices and can be a breeding ground for mould. On nearly all models of washing machine the entire dispensing drawer can be removed quite easily, and once out it is very easy to clean. Get off the worst of the gunk in a bowl of hot water and washing up liquid, and use a toothbrush to get into awkward corners. Then put the drawer in the dishwasher to give it an even more thorough deep clean. To avoid the drawer getting dirty and smelly again, consider switching to a type of powder or liquid which you put directly into the drum of the washing machine instead.
The filter is there to catch any fluff and bits of dirt from the machine and stop them damaging the moving parts. On most machines the filters are right at the bottom and are fairly easy to remove, but you will need an old towel as when you pull out the filter some water will come with it. Rinse the filter under the tap, removing any rubbish and fluff you can see. Filters are in a part of the machine which is warm and damp, so cleaning it out regularly will mean that germs have less opportunity to breed.
The drum of the washing machine is the part where you put the clothes and then it spins around. Drums have lots of holes and cracks in them where germs and bad smells can fester, so it makes sense to clean the drum out by running an empty, hot wash at least once a month. You can use commercially available washing machine cleaning products to do this, but soda crystals or dishwashing tablets are just as effective. Just pop a tablet or a handful of soda crystals directly into the drum and set it to run on a wash cycle of at least 60C to kill off all of the germs which cause the smells and gunk to build up.
Prevention is always better than cure and one of the very best ways of stopping your washing machine from getting dirty and smelly is to allow it to dry out between uses. Most of us automatically shut the door after taking the laundry out, but leaving it open will allow the machine to dry out and will also stop nasty black mould from building up on the seal around the door. If you have to close the door on the machine, get into the habit of wiping around the seal and the drum with some kitchen paper to dry off any excess moisture first.