The lumbering porcupine can easily disrupt the comfort of livestock or pets with a swat of his tail. This author discusses porcupine habits and myths and challenges of quill removal.
Source: Countryside Daily, October 14, 2017.
The best way to remove quills is to immobilize the animal (put a cow in a chute, have someone hold the unfortunate horse or dog and distract it) while the quills are pulled out with needle-nosed pliers. A straight, quick jerk works best. The quills come out nicely if you get a good grip on them with pliers and give a quick pull.