Winning back your ex isn't going to be easy...it's going to take a lot of will, determination, and willingness to change yourself. It's not going to be as simple as striking up a relationship with somebody you've only recently met somewhere...you're dealing with somebody who knows you intimately, and has probably dealt with all your "tricks" before. Obviously, this makes it really quite challenging. If it's worth it to you, go for it, but don't fool yourself into thinking that it's going to be a walk in the park.
It's pretty obvious that if one of the people in a relationship decided to end it, there was something wrong. Finding out what made the relationship fail and fixing it if it's your fault is essential if you want to get make it work any better than before. This journey is going to require you making some serious changes and sacrifices...there are times you may not even feel yourself anymore, but clearly the person you were wasn't cutting it in that relationship. It's all a matter of how much dedication you have to the cause.
A lot of people make the mistake after a breakup of smothering their exes in apologies and attention. That only works in the movies, and a lot of the time it doesn't even work then. What you need to do is give your ex some room to think. Chances are, that person doesn't feel much like dealing with you right now, so anything you do to thrust yourself back into his or her life is just going to make things even worse. You both need a little space and time, so have some respect and let it be for a little while. After a sufficient recovery period, you'll be able to make contact again...gently.
The first contact isn't about your relationship, or what you did wrong or what is needed to get back together...it's just a chance to say hello, see how things are going for him or her. There'll be plenty of time to work on the relationship later, right now the best thing to do is be a friend.
If you play your cards right and just be a friend to the person, it probably won't be long before you're spending a little bit of time together again. When it gets to this point, you're going to have to take different things into consideration depending on which half of the boyfriend/girlfriend situation you are.
As the girl in the relationship, you'll want to stay away from the heavy emotions. Even the most sensitive, emotionally supportive guy in the world is going to have a hard time if you start throwing your feelings at him. It's awkward, it drives people away. Just relax, use this as an opportunity to do things that you both really enjoyed as a couple, and let him see how much you've been improving in the areas of yourself that led to the breakup. Be a good friend, make him comfortable with you again.
For the guys, the most important thing is to listen to her and make it clear that you can be emotionally supportive of her. This doesn't mean for you to be all sappy and hanging on her, it means that you can be the person she needs. Women are emotional creatures, it's just how they're wired...if she can't get what she needs emotionally from a relationship with you, you can't expect her to want to be with you. You need to be the guy she fell in love with...and you too should make it visible that your relationship-breaking flaws have been worked on.
It really comes down to one simple fact: there are two people in any relationship...two people who need certain things from the other. If those things aren't met, the relationship is probably going to end up crumbling and causing a lot of heartache. It's your job to meet the needs of your partner, and help keep the relationship healthy. You are responsible for your partner's happiness, just as your partner is responsible for yours. If you make yourself be the person who can make him or her happy, the person will see that, and your relationship should flourish and the two of you should be some of the happiest people on the planet.