I pull the pads off every few rides and just rinse them off. If they don’t look clean after the rinse they go in a laundry wash bag and into the washing machine with my kit. Often I’ll toss my HRM strap and gloves in at the same time. Active wear (gentle-ish) cycle, mild detergent, and Air dry.
For the helmet itself, wash with microfiber and mild soap like dish / washing up liquid without dyes or extra additives. Rinse well. Water won’t ‘get in’ anywhere so you can feel free to really get it wet. Towel off and hang to dry.
Don’t use abrasive or strong cleaners as they can degrade the foam or ruin the finish.
Edit: To add… if you can’t remove any soft foam or fabric inserts from the helmet, look up how to clean a motorcycle helmet.