There's only one way I know that will likely help, at least in my experience. Its easier said then done but one of those things that gets easier with practice. And its this: become absolutely, selfishly in love with the things you enjoy, the things that bring you fulfilment. Make them your top priority.
After a while, if anyone or anything gets in between you and what you love doing, they will feel like an unwelcome intrusion. This will keep your mind busy and the thoughts of your ex will fade. The ironic thing is, when you seem so aloof and independent, doing your thing as you please, people start to want your attention more.
When you figure out how to be ok with being on your own it becomes a "sellers market". Seriously, I never got so much attention from the people, when I honestly stopped caring about impressing them or "needing" them and focused on myself and my priorities. The thing is, I was too busy to care.
I'm not suggesting you become a misanthrope, just that there is plenty of upside to being single, at least for a while, with the right mindset. The difficulty unfortunately is getting into that mindset when you miss someone badly. So the best way is to maybe say to yourself that you are going to "learn that thing you always wanted to do". Set aside a time and commit to doing that for a short time at first and gradually increase it.
It took me way too long to figure that out, and maybe this is all super obvious stuff to some people. But it certainly worked for me. So I guess that's my advice, I hope it might be useful :-)