Washer odor is usually related to moisture, detergent residue, low-temperature cycles, or buildup around the door gasket and drain area.
A front-load washer can look clean while holding moisture behind the gasket. Leaving the door slightly open after laundry, using the right detergent amount, and running cleaning cycles can help. If the smell comes with slow draining or standing water, a technician should inspect the drain path.
Tell us the appliance brand, model number, and what happened before the problem started.