I remember that from biology class. Affected people would wind the worm onto a stick over the course of several days. One of nature’s wonders.
History
Dracunculus medinensis (little dragon from Medina) was described in Egypt as early as the 15th century BC and possibly was the “fiery serpent” of the Israelites described in the Bible.[5]
https://en.wikipedia.org/wiki/Dracunculus_medinensis
I had a friend in the tribe in NE Uganda who used a dead twig to do the same with one he was slowly pulling out of his ankle.