Trust and confidence doesn't happen overnight, it's a process just like a human relationship. The dog regardless of age associates good things with their human pack: food, shelter, companionship, etc just to name a few
Firstly you can build a dog's confidence by A) do you best to never put them in positions to fail. So if she doesn't like dogs in her face, refrain from taking her into pet stores, dog parks, etc where she will have to face those things at a close distance. Start where she is comfortable, whether is be 5', 50' or 500' and start your work there. B) Always work at projecting confidence and peace no matter what, dogs are very adapt at reading us so if you're uncertain and nervous they will pick up on that and that can add to their own personal stress they may be feeling. Don't coddle the fear by stroking or baby talking them, step in between them and the object of fear and then either freeze there to allow them to investigate it at a safe distance (if it's inanimate and the dog isn't showing signs of extreme stress like trembling, drooling, teeth chattering, etc) or if it's something moving and they've showing signs of avoidance slowly move away keeping yourself in front of the dog.
My poodle is very fearful, she's from a BYB and from day one I have seen her struggle with fear and lack of confidence. I knew she would never be able to be in a class setting or play group so I started with little things. I didn't coddle her by carrying her everywhere, I kept her on the ground once she finished her shots and allowed her to explore at her own pace. If she was behind me I didn't make a big deal about it, I just either stayed still and acted like nothing was wrong or casually walked away. If a dog went to sniff her and she was showing avoidance I would crouch beside her and block the dog from getting close, either by petting the dog and keeping it's attention on me or gently pushing it away and blocking. I rewarded any confident behaviour I saw, if she avoided a fire hydrant and then the next walk went by it without a sideways glance I rewarded. Remember that even a glance towards a object of fear can be a good sign, that means they're not in total avoidance mode.
I have done my absolute best to never ever
force her into something she was showing true avoidance. I've been very fortunate that I have a good vet and groomer that have paired with me that show nothing but kindness and compassion for her. They allow me to stay with her and will step back and take a break if asked to, it's a great tool to have. Life isn't perfect and mistakes will happen, forgive yourself and the dog and move forward and don't dwell on the negative, look for the positive no matter how little and strive to encourage it.
Something I found very helpful was showing her that things weren't scary. So if there was something, let's use a fire hydrant for example and she was showing mild to medium avoidance I would give her extra leash so she had space to move if needed and I would walk straight up to the fire hydrant confidently. I would touch, slap, talk to, even sit beside the object and physically show that it was ok to be around. If she followed me, even a step I would toss a treat and praise her. If she came even closer and came to my feet or into my lap if I was sitting I would treat and praise as well. Not a huge party but a warm "good girl" with a pat and treat. Same thing for other dogs, if I saw the other dog was calm and friendly I would ask the owner for permission to come up and I would give Jazzy space but I would approach and pet the other dog talking quietly to the dog or owner, showing her that the dog was safe to approach. I never forced her to approach but showed her through actions that many dogs are safe
As she aged she became more confident in me, she ran to me if she needed reassurance rather then run away. I don't think she'll ever be a normal confident dog but she's learned through years now of experience that I will protect her from everything I can and she can come to me if she needs help. She knows I will fix the situation by either removing her or defending her from whatever is bugging her. That took months to grow, but it's worth the wait and every tear to see her approaching situations that she cowered at before with a raised head and wagging tail. Those moments are my reward