Your children understand that you're getting a divorce, but they naturally do not understand exactly what it means for them or why it is happening. Of course, their age makes a bit of a difference here, but they probably have a lot of questions.
Often, those questions focus on their own future. Where will they live? Will they still see both of you? Will they have to go to a new school? These are the sorts of things that kids worry about.
The answers here differ from one case to the next, but there's a lot of value in knowing how to answer. That's fairly universal, no matter what you're telling them.
For instance, you need to be honest with them. Don't lie. Don't stretch the truth. Even if you don't want to get into some of the details with them, honestly tell them that, rather than making something up.
It's also important to be patient. They may ask the same things dozens of times. You'll feel fed up, but they need that reinforcement. Tell them again and be compassionate as you do it.
Furthermore, you should encourage them to ask questions and talk about their feelings. Remember that this isn't just some adult decision that you get to make. It impacts their lives. They can't control it. Take the time to help them work through it as you do the same thing in your own life.
Knowing how to talk to the kids is just the first step. You also want to know what options you have to set up a child custody arrangement that works for your family.