Ok, I'll tell you a story. We all probably have exes that we think of from time to time. I used to have one that I still used to think about a lot that I was dating when I lived in Taiwan, which was about 20 years ago. I went back there again recently and went back to some of the places I used to know, like the place I used to live and the place where I met this girl one night and we kissed for the first time.
So I was sitting in this park next to the lake, thinking that the last time I was there I was kissing this girl and I was totally in love with her. I was with her there the day before I left Taiwan and when I left I planned to be back within a few months. Now, 20 years later, I finally returned and this time I was alone and wondering what would have happened if I made different choices in life. Maybe we'd be together now, here or in some other part of the world, or maybe it wouldn't have worked out anyway. Who knows? I know that after I left she met someone else and they're married with children.
I listened to some music whilst I remembered her, felt sad for a while and then I left. And later I realised that the feeling of regret was gone. Somehow it helped me to go back there and remember and create a new memory of that place. Maybe embracing the pain can help you sometimes - you need to feel it fully and then let it go.