This hymn was written as a testament to a difficult time in John Newton's life. He and his friend William Cowper had embarked on a project that was to become the Olney Hymns Collection, but not long into the project, Cowper went insane.
The Olney Hymns /ˈoʊni/ were first published in February 1779 and are the combined work of curate John Newton and his poet friend, William Cowper . The hymns were written for use in Newton's rural parish, which was made up of relatively poor and uneducated followers. The Olney Hymns are an illustration of the potent ideologies of the Evangelical movement, to which both men belonged, present in many communities in England at the time.
Newton wrote that it seemed as though God was going out of his way to make life difficult for him then realized that even through adversity, God continues to work.