Child custody disagreements are often hard to navigate through, especially in the beginning when you're just embarking on the new way of life. One of the most important things you and your ex can do is to come up with the terms of the parenting plan as quickly as possible when you split up. This can help you ensure that you're working as a team to help the children adjust to the new way of life.
When it is time to tell the children that you're divorcing, try to keep the anger and blame out of the situation. The kids are going to focus on what this major change means for them. They are likely going to worry that they will have to choose between their parents. Unfortunately, this is going to be magnified if you and your ex are fighting a lot in front of them and blaming each other.
As you talk to them, let them know that they are still a priority. You'll need to make it clear that you and your ex are both going to have active roles in their life. Part of this means that you'll have to come to terms with never being fully done with having to deal with your ex since you'll still have some events, such as graduations and school plays, to attend at the same time.
Be open to answering the children's questions. Keep things age appropriate and remember that they don't need to know all the details about why the marriage is ending. Instead, let them know that they aren't the cause and move forward to start explaining what the new parenting time schedule will entail. This might be easier if you and your ex have discussed some of the specifics about the new arrangements before sitting down with the kids.