Wipe the gasket where hair and soap collect
If you own a front loader and a dog, the door gasket is doing extra work. Hair, lint, and leftover soap sit in the folds and stay wet. That is one of the main reasons a machine starts to smell like mildew even with a decent detergent, and a two minute wipe after a bedding load heads off a lot of it.
Use a cloth and check the whole circle, including the part you cannot see when the door is half open. Pull the gasket back gently and look for trapped hair. If you find standing water, dry it. If you find black spots, clean them, then run a washer cleaning cycle and keep the door open afterward so the rubber can dry.
In a house that washes dog beds, this is not a once a year job. Make it part of taking the load out. For more on cleaning the washer gasket in a dog home, this short post pairs a quick seal wipe with a monthly empty hot cycle and an open door after each run.