.
From a cis/straight guy’s perspective, I used to find myself in this situation a regularly. I’ve found a good combination of pragmatic coping strategies and reframing the person is helpful. Others have mentioned common coping strategies like distraction and minimizing contact, but I find this alone doesn’t help set you up for healthy relationships because it only treats the person you’re infatuated with as the “forbidden/unworthy object of desire” rather than their own person. So a lot of the reframing I’d do was geared towards reframing then as anyone else that you’re not interested in pursuing, so things like “I’m not their person and they’re not my person”, “they’re not into me and that’s not hot”, “they’re a friend/sibling who has their own life, I’ll support them in theirs, but I should focus on mine”
It’s also always good to put yourself in their shoes. If you were in a relationship and knew someone who you’re not into was infatuated with you, how would you want them to act? I doubt you’d want them to pursue you or conversely treat you like toxic waste just to cope.
It’s infatuation, it will pass. Love must be mutual and is built over time.
TL;DR: As a guy, this usually ends up being a lot of “Don’t be a creep, just be fucking normal.”
Ahh, I see. Pardon my assumption, but your phrasing does suggest to me that you might be younger/teenage–are teens on Lemmy now? Out of an abundance of caution, I’d recommend you try talking to someone a bit closer to you that you trust, like a counselor, older friend, or parent as this does get into a more sensitive topic. Talking to randoms on the internet can be helpful, but also very risky as it’s wild out here and there are all kinds of predators let alone bad advice. I don’t know what your life circumstance is and counselors/parents aren’t perfect either, but it’s usually a much safer starting place. Use your head, verify what you hear.
If you’re an adult, totally apologize. I hope you’d agree with with my caution.