Remove as much surface material as you can using a spoon, a dull knife, or paper towels. Material that is on the surface can get worked into the carpet if you begin cleaning before removing the excess.
Make a solution of 1 teaspoon laundry detergent (must not contain bleach) and 1 cup of lukewarm water. Sponge this mixture onto the stain, and let it sit. Next, mix 1/3 cup white vinegar with 1 cup water and apply the mixture to the stain using a spray bottle. Blot up all excess moisture with clean dry towels, and the caramel should be in lifting out of the carpet and transferring to the towel.
Repeat until you can no longer see the stain. Lately rinse the area with cold water then completely dry with a towel.