I've never met a divorced parent who doesn't have at least some amount of regret about what their children went through as a result of their divorce. That regret in and of itself is not a problem. But if you get mired in it, you can end up compounding the damage. And that is a problem.
Maybe you're the one who caused the divorce by having an affair. Or maybe you didn't want the divorce at all, but there were a few (or 20) things you wish you hadn't said or done during the whole ordeal, and those things had an impact on your kids. If you want to apologize, fine. But read this first to make sure your motives are pure and your methods don't end up adding insult to injury.
One and done. Don't be an over-apologizer. Parents who apologize to their kids over and over again for the same grievance risk hurting their kids even further. Repeated apologies keep the whole episode fresh and that denies children the time and space to get past your missteps specifically, and the divorce generally. Plus, constantly reminding children of your failures costs you some of your parental cred in their eyes, and that affects how well you can parent them. Living through a crappy divorce and having mom or dad left with a diminished ability to parent makes kids worse off than they were without your apology.
It's not about you. The point of the apology is not to make you feel better; it is to convey to your kids that you realize you screwed up, you understand it likely hurt them, and you're sorry for that. So, don't go into it the apology expecting your children to act as your confessor and absolve you of all your sins. It's not their job to unburden you; it's your job to own up for the burden you put on them. They are entitled to their own reaction to what you have to say -- and it might not end with you all hugging it out right away. You have to be okay with that.
It's not about your ex. This counts as an apology: "Remember that time I called my divorce lawyer from my cell phone while you were in the car? I shouldn't have made that call in front of you. I'm really sorry about that."
This counts as blaming your ex: "Remember that time I called my divorce lawyer from my cell phone while you were in the car? The only reason why I did that was because your dad had just drained all of our bank accounts and I had to notify my attorney right away. If your dad hadn't done that, I would have never called my lawyer in front of you. So...sorry."
If it starts as an apology but ends up as a rant against their other parent, that's called an apology fail. The prize for an apology fail is that you owe your kids yet another apology. It's a vicious cycle -- especially for your kids. If you can't apologize without somehow taking shots at your ex, then don't try because you're not ready.
It's not about the historical record. History is a funny thing. It often looks different depending on whose shoes you're standing in. I don't doubt that you have a crystal clear view of what happened in your divorce. But your kids may well have a different crystal clear view of things, and they're entitled to their view. After all, they were there too.
You might think that they weren't there for all of it like you were, but you'd be wrong. They were there for all of their part of it. They were kids whose parents were getting a divorce; you were an adult who was getting a divorce. It's not their place to know everything you know, nor should they be burdened with all of that. So, if you're thinking about using your apology as a Trojan horse to smuggle your own account of history into your kids' heads, stop already. That's not apologizing; that's keeping your kids in the middle of a war that you won't let end. An apology has to come without any attempt to set the record straight or convince them of "what really happened."
Don't bare your soul. The last thing your kids need is more gritty information about the divorce. Apologize, but don't be long-winded about it. A simple, "I know that divorce was tough on you. I'm really sorry for what you went through." Or, "I wish I would have done a better job handling certain aspects of the divorce. I'm really sorry I wasn't able to pull that off." The important thing is to convey that you're sorry, not to inventory all the ways you went wrong. That could end up making them feel like they're reliving the divorce all over again. If and when you're really ready to apologize without any other agenda, make it heartfelt and brief, and then put it permanently behind you.