The front-load boot is ground zero
The rubber door boot on a front-loader holds a fold of warm, soapy water after every cycle. Mildew moves in within weeks if the door stays closed between loads. Wipe the fold weekly and leave the door cracked.
Top-loaders smell differently
Top-load odor usually comes from the outer tub and the drain path: detergent buildup, standing water from a slow drain, and a filter or trap that has never been cleaned.
The cleaning routine that actually works
Run the hottest empty cycle with a washing machine cleaner (or the tub-clean cycle if yours has one), clean the pump filter, wipe the boot and detergent drawer, and repeat monthly in humid months.

Detergent: less is more
Excess detergent is the root cause most people miss. Modern machines need one to two tablespoons of HE detergent. The rest coats the tub and feeds the smell you are trying to kill.
When the smell is a symptom, not the problem
A sewer smell points to drain installation or a dry trap. A burning smell is electrical and means stop and call. Mildew is hygiene; those two are service calls.
