Some cheap coffee can contain a bit of food coloring. Some creamers also do and that can cause a problem. So you’ll need something to cut through the sugary stuff, possibly a red remover and then an oxidizer for the actual coffee stain.
Coffee can be complicated at times. Decaffeinated coffees often have artificial dyes added to them. The hotter coffee is, the deeper it can penetrate into the carpet and fabric. Creams and sugars can further complicate it. I usually start rinsing with a neutral cleaner to remove anything that is easily removable. Then I use a liquid coffee/browning treatment which is a mild reducer. Spray heavily, let dwell and you should see some immediate change. You can repeat if necessary. If it still doesn't budge, use a oxidizing coffee stain remover. I seem to find the most effective ones are the 2 part peroxide/ammonia ones, though I have had good success with Harvard's Stain Magic and even with Sally's 40 volume peroxide. The commercially prepared products for carpet cleaning often contain other ingredients to make the peroxide more effective than 40 volume by itself.
Before I start any stain removal, i prep the customer, my philosophy is simple lower expectations and then over deliver, i prep the customer by saying, "of all the stains in the world 85% can be removed with just plain ole water of the remaining 15% you have a 50/50 chance of removal " then i do the vo do i do