Take the time to talk openly and honestly with a child that a pets life if very much shorter than that of a human.
A child may have difficulty in differentiating between suffering and pain, therefore it is important to explain what suffering means.
Allow them to become involved in the decision making, otherwise they may feel that their bond with the pet has gone unnoticed.
Do not use euphemisms, you are not 'protecting' a child by doing this, you may add to their understanding of death.
Do not make up stories about where the pet has gone, as this may in fact lead to a child misunderstanding what death means (ie don't explain a pets death by saying we have 'lost' the dog - a child will assume that you mean the dog is alive but missing).
Encourage the child to ask questions, but be prepared that some of their questions may appear rather odd, or you may feel they are asking for too many details. Be sensitive in any response you give, but be honest.
Share your feelings with your child and let them share their feelings with you. Showing a child that it is ok to cry or grieve over a pet, it lets the child know that you cared deeply for the pet too.
If a pet was euthanised, be careful that you do not inadvertently imply that it was vet's fault. This will only lead the child to blame the vet for the death of their pet, and will distort a child's mind rather than what a vet actually does to sustain life in a pet.
Allow a child to become involved in making a memorial to the pet. Younger children may seek comfort from looking at a star in the night sky.
You should explain to other adults who may be involved in the child's life eg teachers, guide or scout leaders, that the child is grieving for a pet, and therefore the child may act out of character. Anyone who is involved in the teaching or development of a child will understand.