There’s no magic pill you can take to make the pain of a break-up go away. How I wish there were… it’s so painful and awful to go through. Unfortunately, the only thing you can do is live in the moment and suffer through the process. Feel your feelings, get them dealt with. Pushing them away will not help you heal any faster.
Some things I found that helped me out during my last breakup (we were together 2 years and I was a mess) were exercising (I made myself walk for at least half an hour every day) and being productive. I always heard that exercise helps your mood, but I never really bought it.. but I am here to tell you it works! Both the getting out of the house and working up a bit of a sweat did me SO much good. My mood improved dramatically, I felt good about myself, I felt good about exercising and doing something good for my body.
Then, being productive helped keep my mind from being overly obsessive on the issue. I cleaned house, cleaned my car, organized, etc. etc. These are not things I usually do willingly, but I found them extremely helpful and therapeutic. The best part was afterwards, my environment was clean and organized, which also contributed to my feeling better.
I have to say that if he’s already flirting with someone, he was probably not that emotionally involved anyway, and it sounds like you deserve better. Forget him! Use this time to work on yourself, analyze what went wrong and how you can improve it for next time, and enjoy your freedom while it lasts. :)