Napoleon Hill said this quote

Before success comes in any man’s life, he is sure to meet with much temporary defeat, and, perhaps, some failure. When defeat overtakes a man, the easiest and most logical thing to do is to quit. That is exactly what the majority of men do. More than five hundred of the most successful men this country has ever known told the author their greatest success came just one step beyond the point at which defeat had overtaken them.