Og Mandino said this quote

Remind thyself, in the darkest moments, that every failure is only a step toward success, every detection of what is false directs you toward what is true, every trial exhausts some tempting form of error, and every adversity will only hide, for a time, your path to peace and fulfillment.