Sounds like you’re letting your confidence hang on external validation, which isn’t a good idea as you’re putting it in other people’s hands.
Do things to work on yourself instead like working out or taking steps toward your purpose which can be job or life goals.
I used to think like this and it used to make me feel like shit. When i just focused on improving myself and my own world, it made me feel better as i was putting focus in the right places (e.g. not wasting my mental energy on what other people thought of me) and noticing improvement in these places (because i was working on them myself and was completely in my control to do that, not someone else’s).
You’ll find that working on yourself will by default make you more wanted by and attractive to the opposite (or same, whatever you’re into) sex anyway. So it’s a win/win.