To avoid these types of spills to be soaked into the carpet you must tend to them quickly, which would avoid any unpleasant odor on your carpet. Here are several methods you can try to avoid any permanent damage to your carpet. If you do not feel comfortable removing these stains yourself, you can always contact a professional for any advice. It is important to know with what types of fibers you are dealing with to avoid permanent damage.
Begin by, mixing a digester and apply the solution generously to the affected area. Use a clean towel and gently rub the area to break up and emulsify the stain. Apply a bit more of the digester and leave it for about 15 min. Next, with water extraction rinse the area and leave it as dry as possible. (Remember to always test in an inconspicuous area first before applying any sort of solution to your carpet.)
For this second method, begin by first trying to soak up as much of the deposit as possible, by using a clean towel to blot the affected area. If the stain has already dried, you can use the edge of a knife to scrape away the crust. Mix 2 cups of warm water and 1 tbsp of liquid dish soap. Create suds by mixing the water and soap together using your fingers. Next, use a clean white towel and dip into the solution you have just created and blot the area. Remember to start with the outer edges of the stain to prevent spreading. Use a sponge to blot the area and soak up the solution. Then, use a spray bottle to rinse the area. Fill the bottle with 1 cup of warm water, after you have sprayed the area use a clan towel and blot the area dry. Next, use a spray bottle again to add hydrogen peroxide to the affected area. (Hydrogen peroxide can cause bleaching, so always test in a conspicuous area to avoid damage to your carpet.) Spray the area but be careful not to soak the carpet. Allow the hydrogen peroxide to sit on the carpet for about an hour and then blot the area dry with a clean towel.