Every writer doubts their work at some point or another. Maybe you received feedback from someone that was overly harsh or downright rude. Or your inspiration dried up, leaving you feeling desperate and defeated, or maybe you just can't see the value in your own words. Whatever the reason, all writers encounter these things at some point in their writing careers.
We all fall prey to negativity sometimes and feel discouraged. But, you cannot allow that to stop you from being a writer.
Say that aloud: I cannot allow doubt to stop me from being a writer.
I am guessing that you did not start writing to please other people. I am guessing that you started writing because you felt an uncontrollable urge to translate your daydreams onto paper, that you had a love affair with words since you were a child, that writing gave you a joy unlike any other. If I am right, then you have no valid reason to quit.
It's no secret that first drafts generally suck and that any piece of writing needs to be reworked at least once to make it the best it can be. Sometimes you will get rough criticism and other times it will be accurate. (It is possible to have haters of course and those sorts you should just ignore.) This is all part of the game. But you have to believe in what you are doing. You have to write for writing's sake. That's an essential part of becoming a successful writer, or really a successful anything in this world.
If you are feeling epic doubt, pinpoint exactly why. If it was due to negative criticism, be honest and ask yourself if the person who gave it to you has a point. Maybe your character really is one-dimensional or the ending does seem contrived. If you can see the flaw, you can fix it and move on. If you determine the reader either misunderstood or just doesn't like you or your work for some reason, disregard it.
If you feel like your writing is garbage no matter what, you have to ask some different questions. Do you feel this way because you feel inferior across the board in your life? Did you never learn how to receive compliments or believe in yourself? These are things that frequently are not taught to us and can leave us floundering as adults.
Do you perhaps need to stop comparing yourself to authors who won Nobel prizes for literature? Comparing yourself constantly to others is a surefire way to inhibit your growth and make you feel bad about yourself.
Bottom line: The road to success is not an easy one, but not an unnavigable one either. Keep at it. Others have done it and you can too.
Write on!