Mormonism teaches that the spirits of all people will go to a spirit world after death and wait for the resurrection. Spirits of all Mormons will be designated to a place of peace and joy called paradise. Here they will continue their eternal progression towards perfection by remaining obedient and doing mission work. Spirits of non-Mormons will be designated to a place of hell and punishment called spirit prison. Here, they receive a second chance to learn the true LDS gospel via spirits from paradise doing mission work. Spirits in spirit prison who accept the LDS gospel and repent of their sins hope that a faithful Mormon in this mortal life will go to the temple to be baptized and carry out other ordinances on their behalf. This important mission work is called “redeeming the dead”. In Mormonism, without this important work, a spirit in spirit prison is not able to progress.
“Those in spirit prison have the opportunity to learn the gospel of Jesus Christ, repent of their sins, and receive the ordinances of baptism and confirmation through the word we do in temples (D&C 138:30-35). When they do, they may enter paradise.” (True to the Faith, p. 111)