Before we lived here on Earth, we lived back in our Heavenly Father's presence. While we were there, a plan was presented for each of us to grow and progress to become more like our Him. This plan involved coming to Earth, getting a physical body and then doing the things we need to so that we could return to live with our Heavenly Father.
Those things are clearly outlined in these verses from the Book of Mormon.
Wherefore, my beloved brethren, I know that if ye shall follow the Son, with full purpose of heart, acting no hypocrisy and no deception before God, but with real intent, repenting of your sins, witnessing unto the Father that ye are willing to take upon you the name of Christ, by baptism—yea, by following your Lord and your Savior down into the water, according to his word, behold, then shall ye receive the Holy Ghost; yea, then cometh the baptism of fire and of the Holy Ghost; and then can ye speak with the tongue of angels, and shout praises unto the Holy One of Israel.It is not through these things that we earn heaven, however it is through these things that we learn heaven. This life is a prepatory, probationary period where we are to do all that we can to become heavenly so that when the day comes for us to return to our Father in Heaven, we will truly feel like it is home. It is through these things that the promise of this scripture will be fulfilled.
But, behold, my beloved brethren, thus came the voice of the Son unto me, saying: After ye have repented of your sins, and witnessed unto the Father that ye are willing to keep my commandments, by the baptism of water, and have received the baptism of fire and of the Holy Ghost, and can speak with a new tongue, yea, even with the tongue of angels, and after this should deny me, it would have been better for you that ye had not known me.
Wherefore, ye must press forward with a steadfastness in Christ, having a perfect brightness of hope, and a love of God and of all men. Wherefore, if ye shall press forward, feasting upon the word of Christ, and endure to the end, behold, thus saith the Father: Ye shall have eternal life.