How do you guys deal with rejection especially if it’s a guy you were heavily invested in?

Had a guy reject me recently after we’ve been chatting and getting along really well for the past few months. I’m not mad or anything but there is a weird stinging/hurt feeling to it if that makes sense.