How can one tell true visions and dreams from delusion?
First you look at the person, at their honesty and their state of mind. Then at signs that can be tested from outside. If a prediction no one could have known comes true, if the message serves the good of people, and if its bearer stays steadfast despite persecution, there is strong reason to believe it comes from God.
This is an important question, because not everything a person sees in a dream or vision comes from God. The first test is the person himself. Does he live honestly? Is he truthful, does he refrain from speaking ill of others and from stirring up trouble? Only with a sincere person does the possibility that God speaks to him even begin.
The second test is his state of mind. Someone who has just lost a loved one and lost their balance may see images of that person. Fever or illness can also conjure up things that are not there. Such a person is not lying, but what he sees proves nothing. One's own mind can be deceived, even in honest people.
That is why there need to be signs that can be checked from outside. The first is a prediction about something the person could in no way have known or influenced, which then comes true. The second is the content. Is it about one's own standing, or about making people better? When someone is concerned with the good of humanity and not with himself, his words deserve attention.
The strongest sign appears when someone is commanded to bring a message from God to people. History shows that true messengers met fierce opposition without exception. Jesus (as) brought a gentle message of forgiveness, and yet many turned against him and his followers with great harshness.
Here lies the decisive point. A liar lies for gain, not for punishment. But when someone knows that his message will bring him hostility and suffering, and still remains steadfast, it is hard to call him a liar. His steadfastness itself becomes a witness to the truth of his message.