Parents will tell me that their co-parent has little or nothing to offer their children in the way of good parenting. I gently and respectfully try to get them to see that raising healthy children means having the best possible relationship with both parents. However, you cannot control what your co-parent does and doesn't do. Moreover, attempts to dictate what kind of parent they will be usually backfires and makes things worse. This is actually good news because it keeps you focused on the things that you can change. Your job as a co-parent is to begin focusing on those areas (however small they may seem) where you can feel positive about the other parent and what he or she has to offer your children. All parents have something to offer. Nurturing the seeds of what is good in the other parent can often help more positive things grow. This means that whatever good that parent has to offer should have some pathway of getting through to the child.
Step back and look at your ex-spouse in the role of a parent. Many people make lousy husbands or wives but have the potential to be terrific parents. Don't assume that the parent he or she was in your marriage will be the same parent once you are divorced. Remember also that in some ways, your child identifies with your ex-spouse. On some very basic level, children have a sense that they are 50% Mom and 50% Dad. Any trashing of your ex inadvertently trashes 50% of your child. Also, children have a shared history with both parents, and a shared present and future. Your ex-spouse is an important part of your children's lives, and just as you would help your children succeed in school or sports, it is important to help them succeed in that relationship.