The problem with getting a divorce when you've got kids is that you never can really get divorced. No kids? You can walk away from a failed relationship with a sigh of relief and the thought that it's good riddance to bad company. Have kids and there's no way to walk entirely away without potentially hurting the children, and indeed, hurting your own sense of yourself as a responsible and loving parent.
Except in cases where there has been abuse and neglect, kids generally do better when they know and have regular contact with both parents. To parent well after divorce (when both parents are safe for kids to be around):
Walk in the kids' shoes. Your child may have a different relationship with the other parent than you do. They had no say in whether their family would split up. Many are scared that the absent parent will divorce them too. They need to be reassured that both their parents love them and will be there for them, even if you wish you never had to see your ex again.
Take into account their ages and stages. Young children have a different sense of time than older ones do. For little kids, a week without the other parent around is an eternity. For a teen who is involved with friends and activities, a week can fly by. Consider what the kids need for frequency and length of contact with each parent at this moment in their lives. (It will change as they get older, in which case the schedule can change.) Schedule reliable, predictable contact via phone, Skype, text, and email. Presence and involvement is what parenting is all about.
Keep them out of the middle of adult arguments and adult business: Don't put the other parent down when you're with them. Don't ask them to carry messages to the other parent. Don't ask kids to be responsible for setting up arrangements, changing schedules, or arranging rides. These are adult matters that need to be taken care of by the adults.
Whenever possible, stay in the same town as their other parent: When it's a matter of choice, not necessity, it's important to really think hard about moving children away from their other parent. Visits are simply not the same as regular up-close-and-personal contact. However it is explained to them, kids usually feel abandoned by the parent who moves or resentful of the parent who moved them. They want and need the love and attention of both parents. It's just easier on the kids when they can easily get back and forth between both homes when they forget something, when they want the other parent's advice or help, or when they really, really want the shirt or book or equipment that's at the other parent's house. Both parents can benefit from not doing it alone when hard decisions have to be made or when one or the other is stressed out.
Children need to feel like members of each household, not guests. Optimally, kids need a space in each house or apartment that they can claim, decorate, and use as a retreat. If finances make that impossible, figure out a corner or shelf or a special sleeping bag and pillows that are theirs and theirs alone. There should be on-going evidence that they live in each parent's home in the form of pictures, their art on the fridge, and their toys in a corner. Don't let the need to impress potential dates make you erase the fact that you are a parent from your home. Anyone who is worth thinking about as a potential partner will understand that loving you means embracing your children.
Keep the kids' needs in mind when you need a break. Yes, adults need time for their own friendships, to date again, to have time to go back to school or to pursue an interest. But if you are sharing physical custody, the children are already going without your time and attention some part of every week or year. It's fine for them to see you go off to enjoy yourself now and then but their need for you when you are the present parent takes priority. As a general rule, work out time for yourself by doing things when the kids are in school or with the other parent or when the kids are asleep. Do not leave children under the age of 12 unattended so you can get a break. Don't leave older kids in charge of younger siblings unless you are absolutely sure that they will really take care of the young ones and that they know what to do if there is an emergency. If you have any doubts, swap childcare with other parents or get a sitter. The kids need to relax in the assurance that you are keeping them safe.