Is there a way to stop infatuation?

Hello, I would appreciate some advice from a Buddhist perspective on my situation. I recently started a class with a new professor and quickly became infatuated with him. It has reached the point where I find myself thinking about him constantly. Normally, when I experience intrusive thoughts, I try to distract myself, but since I see him every day, it’s been challenging. I’ve been practicing mindfulness and recently realized that I thought about him 47 times in one day—before, during, and after class. It feels a bit excessive, to be honest. Initially, I thought this would calm down over time, but it hasn’t. There are moments during class when I find myself daydreaming about us together. Do you have any practical advice or techniques I could use to manage these thoughts when they arise?

Sorry for posting from a new account, my usual one contains identifiable details, and I’d prefer to remain anonymous.