How to deal with your ex seeing someone else?

We were in a long distance relationship and after being in a long distance relationship for over a year we decided to break up. It wasn't a messy break up and we were in good terms.

Then a few weeks after our breakup I found out that he's seeing this girl and I feel like she's way prettier than me. I'm obviously still not over him and we still talk as friends just not as often.

I can't help but get jealous and compare myself to this girl. All my friends would say she's not as pretty as me but honestly I think they're lying and only tell me that because they're saying it to me.

My ex keeps saying that he'd still love to see me when he comes to visit and he suggested to see how things go between us when he's here again, if we still like each other again. (No idea when that would be but if our paths cross again)

But I just don't know how to cope with him seeing and having sex with another girl while I'm still hoping that we'd get back together again.

I find myself constantly checking her instagram and become obsessed with her. I keep comparing myself to her and be sad. What should I do?

I'm 20 btw and this was my first relationship