Baptism is a sign to God, to angels, and to heaven that we do the will of God, and there is no other way beneath the heavens whereby God hath ordained for man to come to Him to be saved, and enter into the Kingdom of God, except faith in Jesus Christ, repentance, and baptism for the remission of sins, and any other course is in vain; then you have the promise of the gift of the Holy Ghost. (Teachings, p. 198.)
Joseph Smith also taught that “there is a difference between the Holy Ghost and the gift of the Holy Ghost. Cornelius received the Holy Ghost before he was baptized, which was the convincing power of God unto him of the truth of the Gospel, but he could not receive the gift of the Holy Ghost until after he was baptized. Had he not taken this sign or ordinance upon him, the Holy Ghost which convinced him of the truth of God, would have left him. Until he obeyed these ordinances and received the gift of the Holy Ghost, by the laying on of hands, according to the order of God, he could not have healed the sick or commanded an evil spirit to come out of a man, and it obey him; for the spirits might say unto him, as they did to the sons of Sceva: 'Paul we know and Jesus we know, but who are ye?”' (Teachings, p. 199)