Wipe the gaskets, run the hottest water cycle and run vinegar through it.
1/2 cup bicard and 1 cup vinegar put through a warm cycle. Machine must be empty.
Dry the drum and door gaskets after every laundry session.
If it's a front loader, prop the door open at least 5-6" and slide the detergent compartment open, as well.
Using fabric softener can cause a filmy build up on washer and dryer drums, and leave a slimy mess in the detergent drawer, which should be thoroughly cleaned, regularly. Ideally, switch to felted wool dryer balls and skip the fabric softener, altogether.