1) Learn emotional vulnerability. This makes love and emotional depth in a relationship possible. It also shows confidence and strength as it can be scary. Models by Mark Manson is a great book on this.
2) Learn social skills to manage conflicts and set boundaries, e.g. assertive communication.
3) Deal with your emotional issues, e.g. with therapy.
4) Be attractive and take care of your body. Regular weight training, a healthy diet, dressing well, and grooming well can really transform your physical attractiveness. Spend time really learning these things, and consider hiring experts to teach you, e.g. a fitness coach. None of the emotional or social things above will help if your partner isn’t physically attracted to you.
5) Get good at sex. This depends a lot on what you want, and what the person you are dating wants… and can be taboo to talk about. But in my experience most (but not all) straight women want a partner to be surprisingly dominant and aggressive.
Ultimately all of these just amount to being emotionally and physically healthy.
I had a lot of anxiety about my attractiveness going back on the dating market after ending a 20 year relationship, but I had been working hard on the above things for years. I was surprised to find that, as a middle aged man, I really stood out as a desirable partner, and dating was a really enjoyable experience.