1. Take the visor off, particularly if it has an anti-fog coating.
2. Remove any parts of the lining that you can.
3. Hand wash the removable parts using a small amount of Johnson's Baby Shampoo, rinsing really well. Then rinse again to be sure. And again.
4. If any parts of the lining aren't removable then take the lid into the shower with you and wash inside with Johnson's Baby Shampoo, with diligent rinsing as above.
5. Leave to dry for a day or two in the airing cupboard or somewhere warm.
Just done my year-and-bit-old Shark S500 using items 4 and 5 above. Makes a noticeable difference and it's a much nicer place to put my bonce