When individuals or groups of people turn away from the principles of the gospel, they are in a state of apostasy.
Periods of general apostasy have occurred throughout the history of the world. After times of righteousness, people have often turned to wickedness. One example is the Great Apostasy, which occurred after the Savior established His Church. After the deaths of the Savior and His Apostles, men corrupted the principles of the gospel and made unauthorized changes in Church organization and priesthood ordinances. Because of this widespread wickedness, the Lord withdrew the authority of the priesthood from the earth.
During the Great Apostasy, people were without divine direction from living prophets. Many churches were established, but they did not have priesthood power to lead people to the true knowledge of God the Father and Jesus Christ. Parts of the holy scriptures were corrupted or lost, and no one had the authority to confer the gift of the Holy Ghost or perform other priesthood ordinances. This apostasy lasted until Heavenly Father and His Beloved Son appeared to Joseph Smith in 1820 and initiated the restoration of the fulness of the gospel.
We now live in a time when the gospel of Jesus Christ has been restored. But unlike the Church in times past, The Church of Jesus Christ of Latter-day Saints will not be overcome by general apostasy. The scriptures teach that the Church will never again be destroyed (see D&C 138:44; see also Daniel 2:44).
Although there will not be another general apostasy from the truth, we must each guard against personal apostasy. You can safeguard yourself against personal apostasy by keeping your covenants, obeying the commandments, following Church leaders, partaking of the sacrament, and constantly strengthening your testimony through daily scripture study, prayer, and service.