Rejected but can’t fully let go

I was rejected by a guy friend early this month but I’m still having trouble letting go of the feelings I have. I keep finding my mind wandering back to thinking “what if what if what if”

Any advice on how to move on? I tried talking to other guys but I’m completelyyyy uninterested and it oddly makes it worse