This might be terrible advice, but this is how I go about it when I’m more…mentally stable and emotionally balanced.
Confidence is largely irrelevant.
I wasted years because I kept looking for the ‘perfect’ novel to start my writing career, and I deal with confidence issues every day, but when it comes to writing, this is what I ultimately learned: confidence doesn’t matter. What you do matters. What you write matters.
Learning how to keep writing even when you don’t feel like it is one of the most valuable possible tools you can forge. Great Stephen King quote: “Keep writing, even when it feels like all you’re doing is shoveling shit from a sitting position.”
Although it might be ridiculous and even somewhat juvenile, the greatest piece of advice when it comes to dealing with problems like confidence and worrying if you’re good enough came from Rick & Morty. “The answer is don’t think about it, Morty!”
The professional writers that I’ve read about and had the opportunity to talk to largely have the same advice when it comes to any form of hesitation about your writing: “There’s no magic bullet, no easy solution. You just sit down and do it.” The only way out is through.
Hope this helps, sorry if it doesn’t.