Some things just seem to go together, such as summer and ketchup. But spills are inevitable. Most importantly, act quickly. Remove any excess ketchup with a spoon or knife, but be careful not to rub it into the fabric. Avoid dabbing at it as this can spread the stain.
If the garment is washable, remove the garment as soon as possible and run cold water through the stain from the backside to force the stain out of the clothing. Then, gently rub liquid detergent into the stain and soak the garment in cool water for at least 10 minutes. Wash and air dry. Heat from the dryer can set the stain and make it very difficult to get out. If the ketchup stain is still there, apply stain remover stick, gel, or spray and launder according to directions.
If the garment requires drycleaning, bring it as quickly as possible to the drycleaner and point out the stain. The longer you wait, the harder it will be to remove the stain.