It is tough being a writer. Rejection is unavoidable and there are so many opportunities to lose faith in yourself, to lose your way.
But you musn't.
Which is why I think what you need most as a writer is to believe in yourself. You need plenty of other stuff too, but without believing in yourself and your writing, it will be tough to keep going.
And you must keep going.
So, how do you develop the kind of self-confidence and belief in your work that will keep you going no matter what? Well, I think you always have to work to your own highest level. Always do your best, in other words. You might be able to trick the rest of the world, but you'll never fool yourself. Only you know if you've given it your all at your desk.
And always give it your all.
My advice: if you know you've got one more draft in you, write it. If there is a sentence that is sloppy - keep at it until it's smooth. Don't fall into that trap of thinking no one will notice. In my experience someone always does.
One more thing: don't compare your writing to anyone else's. Run your own race. Do the best you can. Admire other writers, learn from them, allow them to inspire you, not discourage you. And if you continue to write as best you can then someday, somewhere, someone will wish they could write as good as you.