For many people, the most troubling aspect of going through a divorce is trying to figure out what's going to happen with the children. It's imperative that anyone who is going through this situation understands that the children must come first.
Parents shouldn't ever use the kids as a bargaining chip for other aspects of the divorce. The kids shouldn't ever be used as a way to get back at the other parent either. Instead, every decision that's made in the child custody matter must be made with the best interests of the children as the sole focus.
Live in the present, think about the future
The things that led to the end of the marriage won't have a part in the child custody decisions unless there was abuse of the children. You and your ex will both have to move past the issues you have with each other and be there for the children.
Respect and concise communication
You and your ex will have to be respectful to each other. You're a parenting team now and being able to treat each other as such is a huge benefit for the children. They'll see that some things have changed in their life, but they'll know that they can count on both parents to be there for them. It might help to think of the communication with your ex as a business matter so that you can speak respectfully and concisely when you have things to discuss.
The parenting plan that you and your ex work out is the cornerstone of the arrangement now. Try to get this set as soon as possible after you split up. Your attorney can help you to ensure that you have all the important points decided.