So, there’s two separate things here to consider.
First, you want to build your sense of self-worth on something other than whether females like you or not. This means building your life up. Getting good at your job, making more money, having hobbies and getting good at them. Anything that makes you feel good about yourself. You need to fill your life up with these things and not with thoughts of self-doubt because you think girls don’t like you.
Second, you have to interact with other people confidently. As you keep doing more of the first, you’ll find the second easier. But this means not being quick to latch on to people. Being chill and relaxed and assertive and interesting. Not taking rejection harshly. Being positive and uplifting rather than bringing people down.