I learned this lesson the hard way when our first two goats got into the front yard & made a snack of the azaleas. Our vet could either see them after he had finished his in-clinic shift in several hours or I could bring them to him. Bring them I did. Two nubian goats in the backseat of a Toyota Camry (A had the truck on campus & a switch was just not possible).
When goats vomit, they turn their heads at a 90 degree angle to their bodies & shake them vigoursly from side-to-side (which is effectively up&down in this position). I never did get all that nasty yellow foam out of the ceiling of my Camry & I am sure it is still there today. Fortunately this car had power windows so I could easily roll the back windows down enough so they could stick their heads out & then up again to trap them outside (without endangering them I promise).
I do still grow the original azaleas, but I dig up their babies & give them away. Ditto most of the sagos. Those that stay are well away from any accessible fence-opening ('gate' being a fluid term for a goat). Newly planted ornamentals are of edible varieties: ginger, mostly; aloe & prickly pear, edible even as they are unpalatable; sunflowers while they lasted; banana; etc.
Getting goats out of the yard is tricky. They are herd animals & most of them want to be where the others are; lead one out & most will follow. The exception is our grande dame Cinnamon Girl. She does not mind being alone in the yard, the better to eat it all herself. But she does mind getting wet.
Goats in general abhor getting wet. I have seen them fight with a horse who would kill them with one blow rather than leave a stall & go out into the rain, or even a light mist. Feeding on rainy days can be challenging, as the goats must be removed before I can put feed in the buckets & lure the horses in.
To get Cinnamon Girl out of the yard, we turn the hose on her & drive her around the yard until she gives up & goes back through a gate. Getting goats out of a stall is more of a wrestling match. & once out, they cling to the wall, trying to keep all of themselves under the slight overhang that protects them from that horrible, horrible water-from-the-sky. This makes it hard for me to walk this path keeping the feed in the buckets dry.
But nothing would induce me to live without Cinnamon Girl (although I know Mother Nature will intervene eventually). She is a gentle animal with sweet grassy breathe, who likes to rest her head on me, her chin pointing towards mine. & best of all, when I call her she runs to me looking like nothing so much as a maroinette, all ears & strangely jointed limbs, flying flying.