You should first make sure that it is actually a stain an not a burn. Then I would recommend using bleach. If bleach doesn't work then you might try Oxy-clean.
There are many types of stains, so there are many right answers. Here are some examples, but try looking up your specific stain. Proteins wash away fastest if you rinse it in cold water and pretreat...
This is a recipe I used when my children were small two decades ago. It never caused any harm to their clothes at any time, even colors. this is inexplicable but I would check for colorfastness...
Since there are different types of candies there are different ways to clean their stains. Hard candies will come out when rinsed in hot water, which melts the sugars. Spray with a pretreatment if...
If a hot wash doesn't get rid of the stain, try rubbing it with washing powder and rinsing. If it's still a problem you could dab with dry-cleaning fluid, taking great care. Ironing on a low heat...