Toffee & Polly give good advice.
I work in this area and agree you need tk shuft your focus away from thdm anc onto YOU. Every time you focus on them you too open the emotional wounds. Some suggestions for you:
When you feel yourself going down the negative spiral of thinking about them, notice it and interrupt it. If it helps, say 'stop' out loud. Instead ask yourself 'what csn i do to make this better?', 'what would I advise my best friend right now?'
What do you enjoy doing? Do more of thise things. Choose a couple of small goals to work towards or a new hobby/activity/class to try.
Don't look at him/her on social media - this is like torture.
What do you have that us good in your life? Write a list of all the things you are grateful for and stick it somewhere you can see it. When you feel low, focus on the list for 30 seconds and then notice how you feel.
Remember YOU are in control of you. You can't control them or anyone else, but you can control your own thoughts and behaviours. Focus on what you can control and not what you can't - that just sucks your energy.
Ask your friends not to tell you about him/them as it doesn't help you to keep going over everything. Choose to talk to friends who help you to feel good about yourself, not those who love the drama or add to the fire.
Notice how often you talk about it - every time you tell the story you keep the pai alive. Instead what else could you talk about? What are you proud of? Have you learnt new skills as a result of him leaving? If you start to talk about those Instead, you'll shift your mind away from him.
Start to do one small thing that is kind to yourself every day.
OP it"s all about shifting your focus off them and on to you.
Hugs to you x