Joseph said that he translated the Book of Mormon by the gift and power of God and could not translate when he was in transgression.
Joseph Smith, “Journal, 1835–1836,” November 9, 1835, 25-26, The Joseph Smith Papers website, accessed August 11, 2021
I called on God, the Angel told me, that the reason why I could not obtain the plates at this time [1823], was because I was under transgression, but to come again in one year from that time, I did so, but did not obtain them, also the third and the fourth year, at which time I obtained them, and translated them into the english language; by the gift and power of God and have been preaching it ever since.