Do you hear that voice in your head—that nagging, pestering, scolding, disparaging voice? That is the Voice of Self-Doubt. It whispers to you when you say something foolish in a meeting or when you mix up “their” and “there” in an email to your boss. It lives to remind you that you aren’t good enough. Google it, and you will find lists and lists of articles on how to make it go away.

But it isn’t all bad. You may have heard that confidence is the key to success, but we are well-served by a healthy measure of self-doubt. Can we really get ahead without asking what we are doing wrong?

By most popular accounts, Albert Einstein was a self-assured virtuoso with an effortless knack for understanding the universe—with the right spark, he could produce a bonfire of ideas. His general theory of relativity was purportedly inspired by the sight of a construction worker atop a building. The prospect of him tumbling off the roof got Einstein thinking about gravity.

But this anecdote is misleading. Like the story of Isaac Newton and the apple tree, it suggests that physics is what happens when a genius stands too close to a falling object. In reality, scientific progress hinges less on scattered moments of dazzling insight than on the persistent feeling of self-doubt.

Einstein formulated his general theory of relativity in response to the weaknesses of his special theory of relativity, which failed to explain gravity. His rooftop revelation didn’t deliver the answer; it would be another eight years before Einstein sorted out the details.

During just one month in 1915, he produced four successive papers that explained the math behind general relativity, each improving on the one that came before. His work on this subject has been called the “highest intellectual achievement of humanity.”

Einstein once described his method by saying, “I think and think for months and years. Ninety-nine times, the conclusion is false. The hundredth time I am right.” You may read this as a lesson in persistence, but it is just as much a lesson in self-doubt. Assume that you are never right, that your work is never good enough, and maybe you will produce something worthwhile.

Jazz legend John Coltrane offers a case in point. Even among the all-time greats, the tenor saxophonist stands out for his ceaseless practicing. Coltrane’s contemporary, Cannonball Adderley, recalled a period when the musician “didn’t bathe, change clothes or do anything to take him away from the saxophone … Sometimes, he even fell asleep with the horn in his mouth.”

Coltrane’s biographer, Lewis Porter, wrote that his “practice was obsessive, that it was not a simple matter of working to improve, that there was an emotional desperation and drive in it that was somehow beyond the norm.” He was filled with self-doubt. Where others heard perfection, he heard inadequacy. But his relentless quest to conquer his own failings produced groundbreaking works of art.

A Love Supreme”—widely regarded as Coltrane’s magnum opus—was written over a five-day stretch during which he secluded himself from his wife and newborn son. He only emerged after his composition was complete. The New Yorker said the album fulfilled “his finest and highest musical purpose.”

Coltrane’s creative process was the act of eradicating self-doubt, banishing imperfections through practice, refinement and revision. Writer Maggie Nelson described her approach to writing this way in her 2015 memoir, “The Argonauts”: “My writing is riddled with such tics of uncertainty. I have no excuse or solution, save to allow myself the tremblings, then go back in later and slash them out.”

That is not to say that self-doubt is all good. Too much can be counterproductive, even paralyzing. Virginia Woolf would suffer acute anxiety while waiting for a new book to be published and reviewed by critics—a tendency that neither bolstered her health nor improved the quality of the book.

But a judicious helping of uncertainty drives us to do better. It forces us to consider our shortcomings and improve upon them. It pushes us to fulfill our potential. As NBA great Kobe Bryant once said, “We all have self-doubt. You don’t deny it, but you also don’t capitulate to it. You embrace it.”