There are millions of good people being tortured in Hell because they never had a chance to hear and embrace the gospel during their lives. Because God loves all his children, beginning at the death and resurrection of Jesus, spirits residing in Paradise have been sent to preach to those in Hell. Though many in hell have accepted the gospel, there are certain rituals necessary for full salvation that must be performed by a living mortal inside a temple.
Jesus taught his apostles that the living can perform these rituals on behalf of the dead, and this was a practice of the early Church he established. But this teaching was lost during the Great Apostasy, and it was not restored to the Church until the year 1840. As a result, many of our ancestors have been suffering in Hell for hundreds of years or more as they wait for for their descendants to perform these rituals on their behalf.
The greatest responsibility God has given us during our lives on earth is to care for our deceased ancestors. To do this you must first discover their names, and that requires diligent genealogical work. Nowadays this is most often done using the Internet, but can also involve interviewing living relatives and tracking down paper records. Then you must travel to a temple to act as their proxy for baptism, confirmation, the endowment, temple marriage, family sealings and any other required rituals.
You must be at least 12 years old and have a current temple recommend to perform temple rituals for the dead. You may only act as a proxy for someone of your own gender. Do not perform temple rituals for anyone who is not a member of your immediate family or one of your direct descendants. For anyone who died in the last 110 years, get permission from their closest living relative. Do not perform rituals on behalf of those unrelated to you, including celebrities or victims of the Jewish Holocaust.
Though many people pray for the dead, prayers alone may not be of any actual assistance to them. Performing work for the dead is not just necessary for the salvation of the deceased, but it is also a vital part of our own salvation. God has commanded us to perform this important work, and we may stand in jeopardy if we fail to keep our obligations. We should each also keep a history of our own lives that will be available to future generations.