Thomas A. Edison said this quote

Many of life's failures are people who did not realize how close they were to success when they gave up.