The promise is that, despite resistance to Joseph’s prophetic mission, Yahweh would preserve him to do his divine task. The Savior certainly knew that Joseph’s life would end violently, but spared young Joseph that knowledge during the translating. Thus, this verse would have comforted Joseph as he endured persecutions and other hardships as part of the translation process, followed by continuing difficulties after the Book of Mormon was published.