How is knowledge obtained? By revelation.
“… A man is saved no faster than he gets knowledge, for if he does not get knowledge, he will be brought into captivity by some evil power in the other world, as evil spirits will have more knowledge, and consequently more power than many men who are on the earth. Hence it needs revelation to assist us, and give us knowledge of the things of God.” (Joseph Smiht, History of the Church, 4:588).Knowledge comes in two increments: General knowledge/commandments, and individual knowledge/commandments.
9 ...It is given unto many to know the mysteries of God; nevertheless they are laid under a strict command that they shall not impart only according to the portion of his word which he doth grant unto the children of men, according to the heed and diligence which they give unto him.God separates knowledge into these two increments because of eternal law. God promises us that we will not receive a commandment that we are not capable of keeping.
10 And therefore, he that will harden his heart, the same receiveth the lesser portion of the word; and he that will not harden his heart, to him is given the greater portion of the word, until it is given unto him to know the mysteries of God until he know them in full.
11 And they that will harden their hearts, to them is given the lesser portion of the word until they know nothing concerning his mysteries; and then they are taken captive by the devil, and led by his will down to destruction. Now this is what is meant by the chains of hell. (Alma 12:9-11).
...the Lord giveth no commandments unto the children of men, save he shall prepare a way for them that they may accomplish the thing which he commandeth them. (1 Nephi 3:7).
Yet, we are hardly capable of living as God does, which is the standard for living where God does. God will not give you a commandment you are not capable of keeping, which means he will not give you the commandments you are not capable of keeping, even if these are required for eternal life.
Instead, he will patiently send you experiences to build your capacity for obedience until you are capable of keeping higher commandments. He will send them as fast as you are able to keep them, and you will be able to keep them commensurate with how faithful you are to God under all circumstances.
"The portion of his word which he doth grant unto the children of men" contains general knowledge/commandments. They are simple and obvious to extract from the scriptures. Every person who is capable of understanding them is also capable of living them.
Where do we get individual commandments/knowledge? Through revelation.
Thus we see why it is so important to understand the principle of revelation. "The principle of revelation" might seem like an odd way to talk about the topic. Receiving revelation is anything but simple, due to it being a noisy channel.
There is opposition in all things, and revelation is not excluded.
For it must needs be, that there is an opposition in all things. If not so, my firstborn in the wilderness, righteousness could not be brought to pass, neither wickedness, neither holiness nor misery, neither good nor bad. (2 Nephi 2:11).Opposition in revelation comes from counterfeit revelation. Revelation comes from God. Counterfeit revelation comes from Satan or from our imagination.
Revelation comes in many forms: thoughts/impressions, dreams, voices, open visions, visitations. I used to think of things things as a ladder; the higher you go, the least likely the revelation is to be suspect. That isn't true. Actually, these forms are a continuum. The further along you are on the continuum, the easier it is to have faith in what you receive.
It is also incorrect to think that the more important the message, the more tangible the form of revelation. Consider dreams. All of Daniel's revelations came through dreams. Lehi's warning about Jerusalem came from a dream. That's all he got. If you had a single dream telling you to flee from your home to the desert, leaving everything you possess, would you do it? (If not, you have drawn a line in the sand beyond which the Lord cannot bless you.) God is very willing to give incredibly important instruction through impressions, voices, and dreams. If you receive them, take them seriously, because denying them may very well be the difference between blessing and cursing, life and death.
ANY of these revelatory forms can be counterfeited by Satan. With a little time, it would be easy to list out instances of counterfeit revelation through each of these channels documented in scripture. I theorize that anyone who has received true revelation through any of these channels has also received false revelation through them. It is the counterbalance to provide opposition.
How do we avoid being fooled? Joseph Smith spent a lot of time teaching the people how to discern true messages from God. I don't think this is a matter of memorizing which beings should shake your hand or what color their hair ought to be. Instead, I will give you a key that will not fail you. Joseph taught:
A person may profit by noticing the first intimation of the Spirit of Revelation for instance when you feel pure lnteligence flowing unto you it may give you sudden strokes of ideas that by noticeting it you may find it. fulfilled the same day or Soon. (I.E.) those things that were presented unto your minds by the Spirit of God will come to pass and thus by learning the Spirit of God. & understanding it you may grow into the principle of Revelation. until you become perfect in Christ Jesus. (Joseph Smith, WOJS 27 June 1839).Revelation is a gift of the spirit. Joseph taught "No man can receive the Holy Ghost without receiving revelations. The Holy Ghost is a revelator." (Teachings of the Prophet Joseph Smith, p. 328). If you are receiving revelation--even if it is on something pertaining to the past or the present--you will periodically receive prophecies about the future. Pay attention to the circumstances of that revelation. Pay attention to how you feel. Pay attention to what you feel, and what you desire. If what you were shown comes to pass, that revelation is from God, and you ought to ascribe the circumstances of that revelation to be an indication of coming from God. As you accumulate more and more of these, it will become very obvious to you which revelations come from God, which come from you, and which come from Satan.
What you will find is that true revelations are always accompanied by the love of God, and the more dramatic the channel, the stronger the feeling. The only thing that can't be counterfeited is the love of God.
Now, here I have to make some comments. First, feelings are the easiest thing to make up/misinterpret. It is interesting that if you are teaching someone to break free from false tradition, the first thing you do is teach them not to trust their feelings. For example, slaughtering sacred cows always creates cognitive dissonance, which causes negative feelings, and these are erroneously interpreted as a signal that what you are doing is wrong. When you experience the love of God, there is no mistake about it. There is nothing in this world or in your head that can compare to it. That being said, those who have never felt it could easily attach that label to something far different, just as a subterranean dweller who has only heard descriptions of the sun might falsely assume that a flashlight is the sun.
This is why fulfilled prophecy is important. Prophecies act akin to tracer rounds in a magazine: every few bullets, you get one that glows and shows the trajectory of the other rounds that don't glow. If you continue in that path, you eventually get an experience that reveals to you the love of God. For me, these included when I prayed about the Book of Mormon, when Jesus visited me, and one other vision I had pertaining to the future. In fact, the way I was able to recognize Satan when he appeared to me as God was that his visit was not accompanied by the love of God, a feeling I had grown to become so familiar with during revelation that its absence jarred me out of what would otherwise been a very impressive demonstration.