Question: what to do when cat throws up hairballs?
Answer: Groom your cat regularly. The more fur you remove from your cat, the less fur that will end up as hairballs in her stomach. ... 
Give your cat a specialized “hairball formula” cat food . ... 
Use a hairball product or laxative. ... 
Discourage excessive grooming.