How to stop missing him?

Val
I dated my boyfriend for about 6 months and I was sure I was in love. I agree e really bad depression and anxiety and he has anxiety and ocd so he understood everything I was going through but I feel like being around him made my anxiety worse but I loved him so much and I had become so codependent. I just have so many memories with him, he was my first, I explored so many places with him and when he dumped me telling me being with me was draining him and he didn't that it was good for his mental health. Being without him has definitely lifted a lot of my anxiety but I just feel so empty all the time and I miss him but I know that being with him would be so unhealthy. It just hurt so much when we talked after the break up we hugged and told eachother we loved eachother. Now he's smoking weed everyday which he couldn't do when he was with me because I hated it and I feel so hurt and I worry so much about him even though I shouldn't. I'm sorry, this is more of a rant than a question