If you're throwing up stomach acid it usually means you're suffering from Acid Reflux disease or bile reflux which should be checked out by a doctor.
The condition bile reflux happens when bile backs up into your liver and into your stomach and then into your esophagus.
Some other things that can cause stomach acid to be vomited or thrown up include hangovers, pregnancy, overeating, or motion sickness.
Throwing up stomach acid can also be a result of the stomach flu.
If you continue to throw up stomach acid then I would recommend seeing a doctor or going to urgent care to get checked out.
If it's acid reflux then they doctor can usually give you some medications and suggest you go on a different diet to avoid the acid building up in your stomach.