Rejection sucks.
If someone doesn’t like you for who you are it hurts you to your core.
The only silver lining in that pain is that there probably never would have been a lasting relationship with that person anyway.
Honestly, they’re doing a service for you by being upfront in their dislike for you.
Imagine they told you they didn’t like you five years later?
That would hurt way worse and take much longer to cope.
The only real (healthy) way to cope with rejection is to accept it and move on.
“Wow, that person really doesn’t like me. Well, that sucks but it’s okay. They probably weren’t right for me anyway.”
Accept it and move on.
That’s all that you can do.