The Lord revealed the purpose of the Holy Ghost saying that -
"This Comforter is the promise which I give unto you of eternal life, even the glory of the celestial kingdom..." (Doctrine and Covenants 88:4)
It is the Holy Ghost that ministers justification and sanctification for -
"...verily I say unto you, that which is governed by law is also preserved by law and perfected and sanctified by the same.
35 That which breaketh a law, and abideth not by law, but seeketh to become a law unto itself, and willeth to abide in sin, and altogether abideth in sin, cannot be sanctified by law, neither by mercy, justice, nor judgment. Therefore, they must remain filthy still." (Doctrine and Covenants 88:34–35)
For -
"All beings who abide not in those conditions are not justified." (Doctrine and Covenants 88:39)