Make sure your child is ready (see link below to read about readiness). Most children toilet train between the ages of 18 months and 3 years. If they show no interest in the toilet or become distressed when you try to put them on it, they are not ready.
Make regular trips to the toilet. Try to get them on a routine that is compatible with their normal schedule.
Do not punish for accidents! This WILL backfire on you. Stress makes it harder for children to learn to potty train
Instead, reward them for sucess. Sticker charts work well. You can start a marble jar and allow them to drop a marble in for every sucessful trip to the bathroom. Once the jar is full they get a reward (toy, trip to the zoo, etc.) for filling up the jar
For older kids, sit down with your child and make a list of "big kid" activities they want to be allowed to do and "little kid" behaviors they need to stop. Make their "big kid" activities contingent upon them stopping their "little kid" behaviors
Visit the AAP website for more helpful information on toilet training