I've gone through seversl bouts of limerence- which sounds similar. Unrequited obsessive crushes on guys I actually didn't even know that well but, was convinced I was in love with- for years on end. 13ish years spent pining after these people. It was kind of ridiculous looking back.
The way over it for me was to acknowledge this was likely limerence- not love. I was in love with an idea of who they were- the fairytale dream of us being together when- very little in real life suggested we would be.
I acknowledged that, while the maladaptive daydreaming bit was fun. Maybe the nicest part of my life in some ways- to at least imagine myself happy. I had to realise that overall- it was causing me pain. All that longing for them. All that embarassment that they would likely feel disgusted if they ever found out. I felt guilty and ashamed for liking them that way. I'd obsess over the very act of being obsessed.
Realising all of that though- I realised I needed to put a stop to it. For me- the solution was kind of simple in principle but, more tricky to actually do. I made myself stop fantasizing about them- especially in a sexual way. And, it did eventually work.
Plus- it's helped me from slipping back into an obsessive crush. Now and again, I'll get the beginnings of a crush develop but- I'm very cautious to notice it and, I'm strict with myself to try and stop it in its tracks. Because I know how harmful it is to my mental balance.
I don't really beat myself up for having (suspected) limerence though. I think we tend to develop this sort of thing because we may have not felt entirely supported and loved in childhood. That's not to criticize yours or your parents. Mine wasn't all out terrible by any means but, there were problems here and there. I think when we have a lack- we look to fill it- even in later life.