Never put your cap in the washing machine. You risk irreversible damage. Nothing's easier than washing by hand: wet your brush or sponge with water and a cleaning product, then gently rub the stained areas. For cotton, use warm or hot water, or Marseille soap or washing-up liquid. For stubborn stains, add baking soda.