If you are the driver, do not attempt to throw up out the window. You must either pull over or resign yourself to vomiting inside the vehicle. Your safety and the safety of your passengers is much more important than the cleanliness of your car.

Determine which car windows will roll down. Don’t move to a childproofed window that doesn’t roll down. If possible, get to a window that rolls completely down, but any window that you can get your head out of will work. Van windows that crack open instead of rolling down likely won’t work. If you cannot get to an appropriate window, DO NOT open the door. There have been reports of people falling out of moving vehicles while opening doors to vomit. Your safety is much more important than the cleanliness of your friend’s car. [1] X Research source

Be especially careful with this step. There has been at least one reported death when a person leaned out too far in an attempt to vomit. [2] X Research source