Just because washing machines wash away dirt and other stains from your clothes doesn't mean that you shouldn't be paying the requisite attention to them. Washing machines also require extensive attention over time and you should be paying that attention. We have seen a lot of homeowners neglect taking care of their washing machines and then eventually paying the price through dirty clothes. This can be a real embarrassment and you seriously wouldn't like going through it.
Considering that you now know the importance of cleaning a washing machine, you should get to the job soon. All you are required to do here is to soak in some white vinegar and warm water in the machine and run a cycle. Follow this procedure up by soaking some more water inside the machine and you would be good to do.