Coffee spots and spills are widespread and immediate reaction is the best thing you can do against these types of marks. Unfortunately, these stains are not easy to remove, and the success depends on various factors like the type of your carpet, the kind of coffee, and even the temperature of the coffee. For instance, porous mats will absorb more spills than synthetic ones.
To remove coffee stains, start blotting from the outside of the spill to the center. If the spill is stubborn, a dishwashing detergent and warm water solution can be helpful. Spray and blot repeatedly until the stain is removed.