Well it takes awhile to heal. But if you ignore it for the initial shock, the pain will slowly reside. It will always hurt. No matter what. It doesn't go away, so don't worry if you still have feelings, there are always going to be feelings. Just stay happy, and optimistic, and learn something new about each relationship, and bring that to the next one. c: Eventually, you'll find your one and only.
Try to make a friendship out of it. If you both love each other and it just won't work romantically then hopefully it can work as a great friendship. And how to deal post breakup? Keep busy, projects, friends, family, stay social.
You need to find a way to get over them if you cannot fix the situation you are currently in. The best thing is to find a way to stop thinking about them and move on. However, if there is a chance you can work it out, you should try.