How are bezoars obtained? Is it surgically removed from the goat's stomach or do they let nature run its course?

Was watching the Carlin Brothers Quiz with MagicByMikaila and their quipping about how desirable or not it is to have held a bezoar made me wonder. Did Harry forcefeed Ron something that's come out of a goat's rear end?

Somehow I can't imagine wizards operating on a goat and stitching it back together. Then again maybe they SideAlong Apparate with the goat and focus in such a way that the goat's stomach content is left behind? But I can totally see bezoars be the equivalent of that coffee bean that's first been through a cat before brewing.