Mmmm…chocolate. Wonderful to eat, not so great when it's on your carpet.
The first step is to remove as much chocolate as possible without increasing the stain. Grab a spoon and start scooping the excess. After that, you have a few options for actually removing the stain.
Oxiclean: Oxiclean can work wonders on the right material. If your carpet is a lighter color, this is probably your best bet. I like to buy the powder so that I can mix and match the amount of cleaner to the job at hand. I've used this for stains made from chocolate, paint, marker, the mystery stain no one owns up to, and even a massive nacho cheese stain. Follow the directions carefully when mixing, and test it in an inconspicuous spot. Also, don't let it sit on the carpet for too long before rinsing. If you do, you'll have one spot on your floor that's much lighter than the rest of your carpet.
Laundry Detergent and Water: It's good enough for your clothes, so why not put it to work on your carpet? Mix a half cup of detergent with a cup to two cups of hot water. I like to use All Free and Clear for quick spot removal. It's free of dyes and perfumes, which makes it less likely to have an adverse effect on your carpet. Don't forget to rinse after you scrub the spot!