How do I stop doing this?

After my ex and I broke up towards the end of last year, I thought I'd be fine. I got my closure, I knew she had more issues that contributed to the relationship failure than I did.
I felt great after a few weeks, and started dating someone for a few months. But she showed quickly she wasn't a good person.
Since I broke up with her, I keep going through these cycles with the ex from the holidays. Any little thing, like her looking at my social media, to me running into her in public. I latch onto. I have had constant dreams about her and it's just hurt me so much to keep coming back to the same pain, but it keeps happening. Part of me wishes that she'd reach out.
In the past she'd always reach out and we'd make amends and the issues didn't come up again, and something bigger would.
Why does this keep happening?
How do I stop doing this?
Add Opinion