Make sure you clean the water filter (if there is one) then run a wash cycle with nothing but water and a box of baking soda added to the water. During the rinse if you want to double dose, use another box of baking soda. If this fails, you will have to use the soak cycle and use either baking soda, a strong tea, vinegar (I can't stand the smell of vinegar so I never use this) or a bottle of rubbing alcohol. Let it sit for 24 hours and then run a wash cycle.
Clean out the filter, run either bleach or white vinegar through on a boil cycle, and do not use liquid detergents. Leave you washing machine door slightly open so air can circulate.