Baby choking/coughing on vomit?

My three week old tends to vomit or chuck up and choke on it a bit and has to cough to get it up, it tends to be a bit mucusy and he seems uncomfortable and pulls gagging sort of faces when it happens.

Sometimes it’s a lot and watery and sometimes it’s thick and mucusy.

I’m going to take him to the doctors but does anyone have any idea what it could be ?

It scares the crap out of me when he makes choking noises but he always seems to be fine after.