For me I still think about my ex and its been four years since she broke up with me. You just need to give it time really, and erase anything that reminds you of them. Start doing things you enjoy and focus on yourself, even if that means you have to be selfish in some aspects. Personally I believe that being happy is the number one thing you need to focus on in your life in order to function well. When you start doing things you enjoy, that being your lifestyle, work, and what you do with your friends, you'll notice you wont be thinking of them as much again. Unfortunately the thought of them never really goes away. But one day you'll be outside, maybe looking into the sky, doing something you enjoy, or out with friends, and you'll realise it is getting better. Even as that point its still okay to think about them, but its important to focus on yourself, and eventually, you will start thinking of them less.
I only dated my ex for three months, if you were to ask me two years ago if I would take her back? It would most definitely be a yes. There are days were she haunts my mind but I choose to not let it get to me. Unfortunately you have to fight these thoughts, whether you like it or not. Otherwise you'll continue to sink and stand in the same place and continue this cycle. I don't think I'll 100% get over her, but it doesn't effect me anymore, because I choose not to, and I think thats what is important.
I know that my relationship only lasted 3 months, but all relationships are different and she meant everything. It was my first proper relationship and I think I'm a victim of mens first love theory. But In a way, I'm greatful. I think its a learning curve, as a hurtful as it was to go through, which makes me believe in mens second love theory.
I know my advice might not be the best in the world nor what you want to hear, but its honest.