Some carpets have stain-resistant treatments that improve your ability to clean stains, but not prevent them. The best thing to do when you have a spill on your carpet is to remain calm and act quickly.
The majority of stain complaints are simple to remove if you act fast. When a spill occurs, rinse thoroughly with water and blot dry. If the stain persists, consider referencing the manufacturer's warranty for specific care requirements.