I taught my foal to take dewormer by giving him applesauce in an empty dewormer tube. He actually comes up and wants to put the tube in his mouth.
What I usually do is give him some applesauce first, then the real dewormer (or antibiotic or whatever I have to give him) and then after he eats the nasty stuff, another squirt of applesauce.
Now is mother is a whole 'nuther kettle of fish. She will take her dewormer once you get the tube into the side of her mouth, but she will put her head all over the place to try to avoid the tube. So you are wrestling with her until you are able get it into the corner of the mouth. Then luckily you are okay and she will take it and swallow it.
I have been doing the applesauce thing with her too, but because she is so ingrained that tube=nasty dewormer, I will still have to wrestle her to dose her with the applesauce. So I am working on that. She's really funny, because she can smell the applesauce and wants it, but the minute you try to give it to her like dewormer, she fights you. It's kind of funny! I'm like having to force-feed her applesauce. But if I practice it more, I think she will get better at it, because she just has to learn that sometimes GOOD things come in tubes too!
But the foal is much easier to deworm than his momma! He doesn't have the negative associations with the tube that she does.