Most couples don't marry and have children with the idea that one day that family will be broken. Children should be the top priority in all decisions surrounding a divorce, and there are special considerations that should be addressed on their behalf.
1. Be open and honest with your children, but spare them the messy details
Children's minds fill in the blanks when they are not told enough and their imagination can paint a picture much uglier than the truth. While they don't need to know any sordid details of infidelity, spousal abuse, or addictions, do be honest about the general reason or reasons for the break-up. Be thoughtful of their ability to comprehend. You wouldn't tell a 3-year-old the same things you would tell a 16-year-old.
2. Children need to know that you once loved each other very much and that you still love each other as the co-parent:
I know of children who grew up believing that they were conceived by parents who did not love one another and it has held them back in all areas of their lives. They need to see that you are united for their benefit.
3. Children know that they are a composite of the two of you
When you speak of negative qualities and characteristics about your ex, children are fully aware that those same qualities may be a part of their own genetic make-up. Keep the insults to a minimum in front of them. As uncomfortable as it may be for you, point out the good things they got from their other parent: "You got your father's sense of humor." or "I'm glad you have your mother's thoughtfulness."
4. Consider the idea of children staying in the same home on shared custody
Divorce and shared custody is difficult enough. Many couples choose to share an apartment and leave children in the marital home rather than shuffling them back and forth. This is much less disruptive and the things they need (library books, swimsuits, bookbags, computers, etc.) are in one place. There is more security and stability in being able to sleep in their own bed every night. Shifting this burden from them to you is a loving thing to do.
5. Develop the ability to work with your co-parent on decision-making
Do your best to create a cohesive and united relationship when discussing the affairs of the children. It is vital that you present a united front for them so that they don't develop the habit of manipulating one of you against the other. That sort of power is extremely unhealthy for a child.
6. Be flexible in custody
Do unto your ex as you would have them do unto you. If they have special travel plans and want the kids another week, remember that there may be a time when you will want the same.
7. Don't bad-mouth new relationships
Reserve your judgment and don't expect the worst from any new relationship your ex might enter into. Keep an open mind and if issues arise, they are between you and your ex and not the children. Do your best to work things out.
8. Take time to listen
Children will need to talk about what they feel about the divorce. Allow them to speak without jumping in and completing their sentences or speaking negatively.
Above all, try to remember that first moment you held them in your arms and the love you felt for your spouse. That should be the memory that drives your love for them.