Try using afresh washing machine cleaner or run the machine using baking soda and vinegar , you might need to repeat either process 2-3 times . Good luck.!
I would run a cycle on hot with vinegar and bakind soda. And I would also clean inside any seals by hand with some of the same solution.
Here is an article I found for you.
You know what you did ( or didn't do) to get mold in the machine. Try running some vinegar in your water , full cycle, Might need a couple rinses. But you LEFT YOUR WET LAUNDRY LAY IN THE WASHER. NAUGHTY GIRL. That's how mold gets in there. Tide makes a pak of cleaner for the washer.
If your machine is a front loader, you must also get in the habit of drying the gaskets on the door and front of machine. Also, leave washer drawer and detergent compartments open between washings. Front loaders are notorious for this problem.
If is a front load, alway leave door open a bit also clean the black rubber gasket. If door don’t stay open, put a small piece of wood, or a empty roll of bathroom paper.
This is a great step-by step article on how to clean your washing machine - regardless of whether it's HE, top or front loading. Hope this helps and happy laundry day! Hugs, Holly