If you were dumped and they made you feel bad then focusing on the pain is not a solution, focusing on moving forward with another emotion is.
Even if you dumped him and are still second guessing yourself, the same rule probably applies.
Hyper-focusing on something allows addictive emotion to flow. Addiction takes action to replace with positive feelings.
Try not thinking at all about something. We all know how that works. Don't think of a stop sign. See? I bet one is in your mind right now.
When you see him, thinking about the loss, or trying really hard to not think about the loss, will simply make your mind produce the same chemicals it's already making. Feelings of loss.
Think of how you learned the relationship doesn't work romantically. Ignore the nagging voices concerning what could have been, because you know they are counter productive to the friendship. Just acknowledge they exist and let them go. Like hearing a clock tick when you're meditating. Acknowledge the interruption and then get back to relaxing.
When you see him, try to work on active relaxation as well. Breathe deep into your diaphragm. Put a hand on your belly and feel the air push it out when you inhale. Breathe past your ribcage, let it relax. That will help your chest, shoulders, and body relax, and your mind to not associate stress with him.
If this doesn't help to move your mind along, then ask if he's saying things to keep your head stuck in the breakup. If that's what is happening, then just treat his presence as another intrusion, acknowledge it exists, then move on to another conversation. He won't be getting a charge from deluding you or himself, and eventually he'll leave it alone.
So you've learned a couple of tricks to relieve the anxiety of being around him, or thinking of him. Now it's about replacing the pattern in your thinking with something fresh and new. A lot of the time this can be a romantic involvement - the rebound. You're right, though, it doesn't help you heal much, because the rebound usually ends up in a breakup, or a desperate clinging to the new relationship to end the cycle of breaking up.
Focus on your future, on your inner health, and your mind will replace loss with a sense of adventure. You won't be able to predict what that passion for life will be. When you've found it, the new in your world will more than enough to keep you from getting caught up in the wrong guy.
Good luck and enjoy the change.