How do I teach my child to get along with my pet?

Be a role model. Children and pets seem to go together. Children learn to love and care for others while caring for pets. You will need to demonstrate how to best interact with your pet, the specifics will vary depending upon the age of your child and type of pet. Teach your child to recognize behavior clues from your pet (play bow, wagging tail, grimace teeth etc). Always supervise very young children with pets.
By being... ..."the boss" for both. When a clear figure of authority is absent, children try to take on that role for themselves - trying it out on the pet first. Pets rarely take kindly to that: they prefer calm, steady adult authority to pull-tail-first, ask-questions-later caprices of children.