Question: Someone said he saw the Buddha in a vision. How do we know if it was really him?
Answer: If he was not practising mindfulness of the Buddha (念佛) before having the vision, that seen is not so likely to be him (as the cause and effect do not align). If there was no Dharma teaching given, it is even less likely to be him. And if the effect is him being proud, instead of being inspired to learn and practise the Right Dharma (正法) more sincerely and diligently, it is almost certain that it was not him at all.
If there is who seems to be the Buddha seen, there should be continual sincere mindfulness of the Buddha’s name. If the vision is imaginary, hallucinatory or demonic in nature, it will disappear. This is so as with mindfulness of the Buddha, there will be protection from the Buddha, whether he is seen or not. As long as this is not practised then, it will remain doubtful as to whether it was really him.
The above instruction also applies when dying. To know if that seen is the Buddha, who has come to receive and guide to Pure Land (净土), there should be continual recitation of his name (Āmítuófó: 阿弥陀佛). If that seen is a karmic creditor (冤亲债主) who has come to trick, with the Buddha’s blessings connected to from mindfulness of him, s/he will depart.
In the Chinese Pure Land Tradition (净土宗), visualisation of Buddha (观像) is nowadays discouraged when living and dying as not only is it extremely difficult to practise well, there might be confusion of the visualised Buddha as being the actual Buddha. It is even warned that such visualisation practices make it easier to encounter and be confused by the demonic (着魔).