What makes vomit different from a normal spill
Most spills are one thing: coffee, juice or wine. Vomit is several problems at once. It is acidic, so it can loosen or shift the dyes in carpet and fabric if it sits. It carries stomach acid, food proteins, fats and sometimes bright food coloring from sports drinks, candy or medicine. And it carries germs.
Each part needs a different answer. The solids have to come off before anything else. The acid needs to be diluted, not left to dry. The protein reacts badly to heat, so hot water, a steam iron or a hair dryer can set it into the fibers like a cooked egg. The odor lives where the liquid soaked in, often in the backing and pad under the carpet, not on top where you can see it. Get the order right and most fresh accidents come out at home.