H.,
Everyone else has covered the basics, but when it happened to me, my mother advised a solution of 1/2 vinegar and 1/2 water. Saturate offending area and let sit five minutes. Then sop up any remaining liquid. When carpet feels dry liberally pour baking soda. Again let it sit, then vacuum up. Finally, give it a good febreezing.
My son was 18 mos when he had a terrible stomach bug for 10 days. I was cuddling him in our rocker/recliner when he threw up all over me and it. I could not sit in the chair without gagging until I did the vinegar/baking soda/febreeze.
I don't have pets so I've never heard of the pet stuff others have recommended. Good luck to you momma.