Dishwashers should not be used to clean helmets. It may seem like a quick fix but as dishwashers use heat, this can damage both the outer and inner parts of helmets and there is even a fire risk.
Start by removing the pads inside your helmet. These will vary depending on what helmet you have, but they usually use velcro.
Wash these pads either by hand with a mild soap and a soft sponge or cloth or in the washing machine according to the manufacturer’s guidance. DON'T PUT THE WHOLE HELMET IN THE WASHING MACHINE.
Air dry the pads then clean any other dirt from the inside of your helmet with a cloth or brush.
Clean your helmet straps by rubbing soap/washing liquid into them with your hands.
Once you’ve cleaned the outside and everything is dry, reattach your pads, and you’re good to ride. Then repeat!