It looks like it came out of your skin just below the knee? Is that right?
My guess about this is that it is either a ingrown hair or what came out of a subaceous gland and probably not a worm or other parasite. If you pulled it out and it came in one piece it may be a hair that didn't develop properly and became infected. If you could tease it apart it may have been from a subaceous gland that got stopped up
It is surely scary looking, enough to make you nervous.
Why are you taking valbazen and ivermectin ? Were they prescribed by a Dr.?