How do I detach myself from someone i had sex with?

Long story short, I had sex with a man (only once although we kissed and did other stuff multiple times) and although we both agreed not to "get feelings", I did, I think. Or I'm at least attached to him. Partly is because the way we met which was like him "saving" me (not literally but he was there to help me in a time of crisis out of nowhere) and then the sex, I just became attached. The problem is, I don't think he wants to continue having sex and he's definitely not interested in a relationship. We're still friends, but he's been talking less and less to me. So, how do I let go of him? It's so hard for me. I know I should just block him or stop talking to him and move on but even if we don't talk anymore I think about him all the time. I just feel like there's a reason we met and I can't get that feeling out of my mind. And I can't stop replaying the sex either. Ugggghhh. I literally can't even sleep