Do I deserve him? Am I in the wrong?

So I've been with my boyfriend for 2 years and I love him to the moon 🌙 and back but sometimes I still think about my ex. Not in a way like "I miss you & I want you" more like a "We could've had it all but you hurt me" I think what hurts me so bad is that I trusted him with something you give to someone special and all he did was use it against me and throw it in my face. I also feel like it's hard for me because just when I get him out of my head, he texts me or passes by my house. Yeah, he literally drives around my house sometimes. I dont keep this from my SO though, I tell him how I feel and how sometimes I still hurt and he understands and treats me so well. That's why I want to forget but I don't know how because sometimes It's gets in the way.. Sometimes my boyfriend & I have a small argument and it turns into something big because of me & trust issues. I really love him and I feel like he deserves better because he doesn't need to be with a girl that can't get over what a trashy guy did to her.