"We're getting divorced" are not the words any child wants to hear from their parents. Unfortunately they're words that sometimes have to be said.
How parents tell their child about divorce needs to take into consideration the age of the child and what he or she is able to understand from a developmental perspective.
Our culture tells us that children are resilient and they'll recover from the effects divorce. However, that resilience probably won't happen without some parental guidance and reassurance that they will be able to adjust to the changes in the family. The effects of divorce on a child can be lifelong if attention isn't paid to helping the child adjust.
If you're divorcing you need to know as much information as possible to help your child make a good recovery. Consulting with a therapist or parent coach about what to say to your child is a good starting point. A professional who is experienced in helping families adjust to divorce will help you better understand how your child perceives divorce, possible effects on your child and how you can help your child manage the many emotions they are feeling.
Don't assume your child will be okay after a divorce and don't hesitate to ask for help.