If you are lucky, the head either isn't glued on or the glue is so old that it will pop right off.
If the head IS glued on, you can remove it easily by dunking the head in boiling water to loosen the glue. or by using an xacto knife to very gently cut through the glue.
My personal preference is xacto knife.. I tried the boiling water method before and it actually deformed the neck of a few of my ponies. >.<
Once the head is off, just reach inside with some pliers and tug the tail out by the metal clamp.
To insert the tail in the new pony, loop some floss or beading wire around the middle of the tail. Insert the floss or wire through the inside of the pony though the tail hole. Pull the tail through either by tugging the floss or wire completely through the hole. If it is a bit hard to pull, use pliers to hold it so it doesn't hurt your fingers.
This lets you leave the original clamp and washer in place if they are in good condition.
If you need to know how to do it with replacing the washer and clamp, just let me know and I will add that info in for you