Give yourself time to heal after a breakup
One thing I've definitely learned, is that you absolutely can not transition directly from a breakup into being friends again. It
Some people think if the breakup was amicable, and they had a friendship with the person beforehand, they can break up and still casually hang out. False. It always ends in either constant discussions about your prior relationship or touching each other inappropriately, leaving both parties confused, resentful and/or wallowing in sadness and regret.
I feel as though I should define the difference between a relationship and someone you casually 'hook up' with (trust me, it grosses me out as much to type that term as it does for you to read it). If you stop casually hooking up, and try to be friends again, that can work. Since there was no commitment in the first place, there isn't much room for either person to be upset when and if all relations stop. However, if you're in an actual exclusive relationship, and you break up, it is hard enough to deal with without added pressure of hanging out and having to be careful of what you say and how you act.
Another thing that makes it complicated, is when one person is totally fine hanging out as 'just friends', which I hate to break it, means they probably didn't care much about your relationship in the first place. Someone who is actually emotionally invested would have a much harder time just hanging out casually with someone that they truly cared about or loved deeply. Then when you're around the other person and they could care less that you're not together anymore, it makes you feel like crap. And no one likes that feeling.
The waters also get extra muddy when you're hanging out in social situations where the person you just broke up with may be flirting or being flirted with. That sucks to watch, especially if you haven't had enough time to heal or still have feelings for them.
So all in all, my advice is to cut all ties for a period of time until you are fully over the person and ready to move on. Then these things are less likely to bother you, and you are less likely to get sucked back into a relationship that obviously ended for a reason. The 'period of time' may vary, depending on how long you were in the relationship, how you really felt about the person and a bunch of other circumstantial variables.
But either way, a safe period of time is to stop talking to them is at least a month. By cut all ties, that means un-friend them on Facebook, delete their number from your phone and if you have mutual friends, don't put yourself in a situation where you may run into that person when you're not ready. You can find other things to do for a while, trust me. Doing these things will help eliminate any temptation to contact that person, especially when you may be in a questionable state of mind.
Now all of that being said, no one is perfect. You may have a relapse, and 'innocently' drunk dial the person, or randomly stalk their friends on Facebook to get a glimpse at what their life is like now. We've all done it. But that doesn't make you a terrible person, and you can still take steps to move forward after your regression.
When you falter, just remember there was a reason you broke up, and focus on that part. Find things to do to occupy your time and work on yourself. Hang out with your friends, take a vacation, have a party, starting working out - the possibilities are legitimately endless. After all, you're single, you can do whatever the heck you want!