You may want to curse him out, cry or ignore him, but if you have to continue to work with this person, you have to reel in those emotions and be a grownup and a professional. You rolled the dice, it didn’t work out – that’s the chance you took – so be an adult about it. Breakups are hard, especially if you were the one who was dumped, but throwing tantrums or having crying fits at work is not acceptable. And if you dumped him, remain cordial and professional so that he isn’t tempted to act a fool at work either.
If the breakup was a bad one and you have to release, go for a walk or call a friend to help you work through it. Just try to confide in a friend who does NOT work in the same office with him so that there are no awkward situations. And whatever you do, don’t use company email to send him nasty messages, or argue or have relationship discussions with him at work. That’s not the place or time to air your dirty laundry.