My cat was sick on my beige bedroom carpet. It was an orange bile colour plus I took a few days to clean it.
Ace bleach for laundry stains took every bit of it out. I use it in a spray bottle. I just sprayed carpet well about three times in all and covered with kitchen towel and trod in to absorb the stain.
My carpet is quite old so I was not too bothered if it didn't work but maybe test on an inconspicuous area before using.