So he's coughing?
Seriously, is one end of that worm forked on one end, hard to tell - if you still have that worm get some better photos.
I would go get some Safeguard Liquid Goat De-Wormer asap! Give him 0.23ml per pound of weight orally once a day for 5 days in a row.
Don't delay on getting the meds. If that is a Gapeworm, hopefully you have caught it early enough that there's not too much damage and he will recover.
Look at Tractor Supply in the Goat Section. If they don't have the liquid, then you can use the paste which is in the Horse Section. Get the smallest syringes they have at your Tractor Supply.
View attachment 2388497View attachment 2388502