Use a blunt knife or other instrument to gently pull off as much gum as you can without expanding the spot or rubbing the gum more into the fibers. The less gum that remains on the clothing after this step, the easier the other steps are.
Put the clothing into the freezer or into a bag with some ice cubes. Alternatively, put ice cubes directly onto the gum. In either case, leave the gum in the cold long enough to freeze completely.
Once the gum is frozen, just pop it off the clothes with a dull knife or scraper. The gum should fall off completely.
Use an enzyme-based soap if possible. Rub it into the spot where the gum was and then launder as usual.
Take the clothing out of the machine, and allow it to air dry completely. Check the area carefully in bright sunlight to ensure there is no more stain present. Once you are certain the stain is completely gone, launder and dry as usual.