If you happen to vomit or throw up underwater then the vomit will just be pushed out into the water and float away.
I had that happen to me before when I was swimming underwater and threw up before I was able to come back to the surface.
The vomit just spread out underwater and the pool had to be closed down and cleaned because of the vomit.
If you're scuba diving with the air tank and regulator then scuba divers are taught to just vomit into the regulator and then clean the regulator after they resurface.
Nothing terrible will happen when you vomit underwater but it's best to avoid it if possible and try to get to the surface of the water before you vomit.
If you're feeling sick then stay out of the water.