Alma 40 is a purely doctrinal chapter on the afterlife.
Part of Christ's atonement was to be resurrected thus ensuring the resurrection of every person born. As Alma states in verse 4, "all shall come forth from the dead."
Paradise and Hell
But before we are resurrected, we must wait a period of time … "there must needs be a space betwixt the time of death and the time of resurrection." (Alma 40:6) It is this period of time about which Alma had questions.
He taught his son that upon death, "the spirits of all men … are taken hime to that God who gave them life." (Alma 40:11) Depending on how we have lived our lives, we are either received into a state of happiness and paradise or into a state of outer darkness and weeping and wailing and gnashing of teeth. Those who have obeyed the commandments and who are righteous go to paradise while the wicked are held captive by the devil. All souls remain in one of these states until the time of their resurrection. (Alma 40:14)
In Alma 40:20, Alma gives his opinion that the righteous from the time of Adam to the time of Christ would be resurrected at the time of Christ's resurrection. (Alma 40:18, 20) We read in Matthew 27:52-53 that "the graves were opened; and many bodies of the saints which slept arose."
"The soul shall be restored to the body, and the body to the soul; yea, and every limb and joint shall be restored to its body, yea, even a hair of the head shall not be lost; but all things shall be restored to their proper and perfect frame." (Alma 40:23)
For a complete list of scripture references and explanation on the resurrection, see the Guide to the Scriptures: Resurrection.
I am grateful for the resurrection. I can only imagine the peace this knowledge would bring to those who have lost limbs or whose bodies are ravaged with disease. I am thankful for the good health that my family and I have enjoyed thus far. Despite a record of good health, my body is not getting younger and each time I play basketball, I realize that I am aging. How wonderful it will be to have a perfect body that will never grow old again and will never tire! The resurrection will be wonderful!