How did you get over your ex?

He treated me so well but we had to end it due to long distance. It was just the wrong time and place, honestly, so it makes it difficult to get over him. It’s been since February and we had been together for 18 months at that point. The whole relationship was over long distance and I saw him maybe once every two months. We had sex in January for the first time, too. But anyways, I thought I would be okay and had gotten over him but a song that we used to listen to just came on and I couldn’t help but breakdown crying. Any advice?