The old wive’s tale is that you can entice tapeworms out with a bowl of warm milk.
I have no idea if this is true or not, and don’t really fancy googling it to find out.
Threadworms are different - I’ve never heard of them being enticed out with anything.