How do I deal with this situation

Broke up with my ex a couple of weeks ago, haven’t got over him yet obviously, I have to see him everyday at college and we’re friends with the same people. He’s been trying to get with my mate, they’ve openly been flirting in front of me and it’s really painful. What do I do when my feelings have already been made apparent to the both of them?