I used to be like that too but after hearing some great authors talk about their work and their story I've realized they have gone through that too but they kept writing. So just do it, even if you feel like that keep writing. Instead of letting that bring you down use it as fuel, let it inspire you, make you want to become better.
I feel that self-doubt is a result of being too aware of yourself. Instead, become absorbed in what you are doing. Lose yourself and enjoy whatever you are reading and writing.
Even if it is not as great as the books you are reading, every great author had to start somewhere, just like you are. It’s amazing that you are trying to get better at writing, and with practice, you too will be as great as them. To deal with self doubt I just kinda push through or look at my old work compared to now, and see the change that has occurred. (This works better if you have been writing for a while) Even writing a little bit can improve you, as well as reading those books, as you kinda are influenced by them.
I had the same fear. It took me a month to get over it but I did. I decided that enough was enough. So what my writing wasn’t good enough? If I didn’t put myself out there, how was I supposed to get better? Some of my writings get good feedback, others not so much. To keep going, I remind myself that it’s about the process of self-improvement and not the result. The result will come with practice
You have to learn to stop comparing yourself to any great writer or author out there and start comparing yourself to your yesterday self. Use those great writers as inspiration. Stephen King used to rewrite great authors' books by hand in verbatim until he found his own style or voice in written words. He also has a daily goal of 2,000 words per day.
No matter how much you think other people's work are impeccably written, there are certain stories, thoughts or inspirations that only you can give to your readers. Focus on providing value and when self-doubt creeps up again remember that you're doing yourself a disservice if you succumb to those doubts, as well as those people who need your light.