According to Catholicism how does a person discriminate between hearing the true word of God versus a hallucination or a demon? How does the Catholic Church answer this question:

Suppose you hear God make you a commandment, how do you differentiate that from either your own internal monologue or from an imposter angel or demon, a hallucination or of the word of God himself?

I don’t mean to ask advice for myself, but in a general sense, how does a person differentiate between the word of God as many describe hearing in the bible from an illusion or an imposter.
Private Revelations and the Discernment of Spirits?

I am aware that this is a long post, but Fr.William Most does a very thorough job on this subject and it would be best to let him explain things here.


  Principles for the discernment of spirits
  
  What kind of Spirit is at work when someone receives a vision, a revelation, or a more routine favor? To determine this is called the discernment of spirits. It is of great importance to find the right answer. It is evident that there can be three sources: good spirit, evil spirit, auto-suggestion.
  
  Five causes of error in revelations
  
  1. Faulty interpretation of visions by the recipient.
  
  St. John of the Cross warns about this in Ascent of Mount Carmel II. 19. Thus St. Joan of Arc in prison had a revelation that she would be delivered by a great victory--it was her martyrdom, which she did not suspect.
  
  Prophecies of punishment, and promises of special favors should be considered as conditional. E.g., the Scapular promise should not be taken to refer to mere physical wearing of the Scapular: it must be, as Pius XII said, the outward sign of consecration to the Immaculate Heart of Mary, that is really lived. If it is used this way then even if the vision of St. Simon Stock might not be true, the promise will be fulfilled, as we explained earlier.
  
  2. Visions of the life and death of Christ, or other historic scenes, must be understood to be approximate only.
  
  Thus some saw Jesus with three nails, some with four. Blessed Veronica of Binasco saw the whole life of Christ, and so did St. Frances of Rome and Catherine Emmerich. The Bollandists, Jesuit experts in studying the lives of the Saints, tell us there are many historical errors in these.
  
  NOTE: Pope John XXIII, ordered The Poem of the Man God put on the index, on Dec. 16, 1960. The Index is now abolished, but Cardinal Ratzinger in a letter of Jan 31, 1985 wrote:..."The Index of forbidden books keeps all of its moral authority and therefore the distribution and recommendation of the work is considered improper when its condemnation was not made lightly but with the most serious motivation of neutralizing the harm which such publication could inflict on the more unwary faithful." So the Pontifical Imprimatur claimed for it is bogus.
  
  3. Human action may mingle with the divine action.
  
  St. Catherine Labouré foretold many events correctly, but failed on others. It is especially easy for this to happen with ideas that appeal to our own desires or fit with preconceived ideas. Benedict XIV (Heroic Virtue III. 14. p. 404) said: "The revelations of some holy women canonized by the Apostolic See whose saying and writings in rapture and derived from rapture are filled with errors."
  
  4. A true revelation may later be altered involuntarily by the recipient.
  
  This happens especially with intellectual locutions which need to be translated into words. Again, God may seem to promise a cure without saying if it is total or partial, sudden or slow, or even physical or moral. Again if a revelation is received in an instant, but it takes long to write it all down. St. Bridget admits such a thing in her own case.
  
  5. Secretaries may alter without intending to do so.
  
  The accuracy of the text is disputed in the works of Mary of Agreda, Catherine Emmerich, and Mary Lataste. It has been shown that 32 passages from the latter have been taken word for word from St. Thomas' Summa Theologiae.
  
  Similarly, compilers sometimes modify them. The first edition of Catherine Emmerich had St. James the Elder present at the death of the Blessed Virgin. When it was seen that this was incompatible with Acts of Apostles, it was dropped from later editions.
  
  Five Causes of False Revelations
  
  1. Pure bad faith, fakery.
  
  Magdalen of the Cross was a Franciscan of Cordova, born in 1487, who entered a convent at age of 17. From the age of 5 the devil appeared to her as various Saints, led her to desire to be considered a saint. At 13 he said who he was, offered an agreement: he would spread her reputation for holiness, and give her at least 30 years of pleasures. She agreed, and it all came true--ecstasies, levitation, prophecies, simulated stigmata. At door of death she confessed. Exorcism was needed.
  
  2. Overactive imagination.
  
  We said above that human faculties may mingle with the divine action. Someone may imagine a saint is near him. He may imagine intellectual locutions. Cf. St. John of Cross, Ascent II. 29. St. Teresa said (Interior Castle 6.6) that if one has once had a real vision, he will recognize the deception.
  
  Hallucinations can come from excess in abstinence, fasting, and vigils.
  
  3. Illusion in thinking one remembers things that never happened.
  
  Some may imagine they have had visions. Some invent stories and convince themselves--in good faith. Some relate trips to far lands where they have never been. The line between imagination and reality is dim in young children--something similar can happen later too. This is not rare. If a spiritual director finds his advice has little effect, there is reason for seeing illusion. Some make false charges in courts in this way.
  
  4. The Devil may give false visions or revelations.
  
  We saw this in the case of Magdalen of the Cross.
  
  5. Predictions by falsifiers.
  
  Some make these at first for their own amusement, then find they have a tiger by the tail. St. Bonaventure (De profectu religiosorum III. 76) said he was fed up with such things, on the troubles of the Church and the end of the world. During the great Western Schism at end of 14th century, there were many holy mortified men who had false revelations, and even thought they would be the pope. At fifth Lateran Council in 1516 Leo X had to publish an order prohibiting preachers from giving public prophecies. There were many during the French Revolution, clear and in detail on the past, vague on the future.
  
  In 19th century there was an epidemic of prophecy especially on "the great Pope and the great King" inspired by the 17th century commentary on the Apocalypse by Ven. Holzhauser. Pius IX in an Allocution of April 9, 1872 said: "I do not give much belief to prophecies, because those especially that have come recently do not deserve to be read."
  
  What degree of certainty or probability is possible?
  
  1. When God so wills, He can give full certainty to the recipient. We who are not the recipients can also be sure of revelations given to another, e.g. , the OT prophets, for they furnished certain signs of their mission. This can be done by miracles worked in a framework in which a tie is made between the miracle and the claim.
  
  2. Beyond this area, probability is the most that is attainable. We need then to work with various signs. We should: (a) Get detailed information on the person to whom the revelation seems to have been made; and on what facts seem to have been revealed.
  
  Often we must work by exclusion, i.e. , show that it comes not from the devil, nor from the human mind. But psychology still cannot give full replies on some things that seem supernormal operations of the human mind: hypnotism, somnambulism, telepathy, thought-reading, etc. For data on the uncertainties of psychology see Richard M. Restak, [Neurologist in Washington D. C. ] "See no Evil. The Neurological defense would blame violence on the damaged brain" in The Sciences, July/August 1992, pp. 16- 21.
  
  3. Inquiries to be made about the alleged recipient:
  
  (1) If the person is canonized, the Church has already checked--but canonization does not guarantee the truth of any supposed revelation given to the Saint.
  
  (2) If not canonized:
  
  (a) What are the natural qualities or defects, physical, intellectual, and moral. Is he sincere, cool-headed, of sound judgment, of perfect mental equilibrium. Or is his mind weakened by poor health, vigils, fasts etc.
  
  (b) Degree of education of the recipient--what books he has read, what information he may have picked up from other more learned persons.
  
  Much care is needed. Some say that Mary of Agreda was an ignorant girl. But she could read, knew the Bible well, and Cardinal Gotti showed several of her revelations were borrowed from a 15th century book, The Raptures of Blessed Amadeus. And she admits the help of theologians. Yet she said, in exaggeration: "No human mind could have imagined this work" (III, # 789).
  
  (c) What virtues does the person have? What was his general level before and after the alleged revelation? If a great advance in holiness is seen, and it seems to have come from the revelation, there is good probability for the revelations. We think of the Fatima children. But if the seer has stayed at the ordinary level of virtue, the visions come under some suspicion, for would God use extraordinary means to lead to a merely ordinary state of holiness? Exception: God might use an ordinary person to help others. The message of Fatima for example would have ample justification even if the children had not become holy: this message God wanted given to the world. And the three things asked for are theologically sound and called for independently of any revelation.
  
  (d)We need to watch out for the work of satan--he may really promote good things for a while, provided that in the long run he gains. The revelations of Necedah, Wi. seemed to have good fruits, yet were false. Rosaries were said to change to gold. Similarly for Bayside. But disobedience showed them false. St. Margaret Mary was told by Our Lord: (Autobiography, #57):"Listen, My Daughter, and do not lightly believe and trust every spirit, for satan is angry and will try to deceive you. So do nothing without the approval of those who guide you. Being thus under the authority of obedience, his efforts against you will be in vain, for he has no power over the obedient."
  
  Sometimes satan urges people to immoderate penances, so that they will in time give up. He may make contemplatives desire the active life, or vice versa. Blessed Jordan of Saxony, second General of the Dominicans, contracted a high fever. He had a prior skilled in medicine who told him to sleep on a soft bed. But satan appeared to Jordan in the night and rebuked his self-indulgence. Jordan gave into this two nights. But the third night Jordan saw that he should obey his doctor, and so did. Jordan had previously put himself under obedience to the doctor.
  
  (e) Humility is a major key. Satan has the greatest horror of it. (Cf. the above words of Our Lord to St. Margaret Mary.) Yet satan can lead a person to false humility. Pride shows in contempt for others, in an independent spirit as to the Superior and the spiritual director, in obstinacy in opinions, in refusal to submit to examinations (cf. Teresa Neumann), in anger. It shows too in desiring to publish the graces the person thinks he has received--when it is not necessary. Humility leads to wanting to hide them, except in cases of real usefulness.
  
  (f) Has the person claimed revelations before? Made predictions that were not fulfilled? If there was no reason to suppose the failed predictions were conditional, then they will seem not of divine origin.
  
  (g) Has the recipient suffered great trials before or after the revelation, such as sicknesses, contradictions, lack of success. Extraordinary graces are very likely to bring great trials, as St. Teresa of Avila remarked, (cited above), in Interior Castle 6. 9. It is specially likely that the recipient will encounter skepticism or hostility. Bl. Juliana of Liege was chosen by God to establish the Feast of the Blessed Sacrament. Visions on it began two years after her entering the novitiate at age 16 in 1208. Only 22 years later did she dare to submit her project to some learned theologians, who approved it, but her enemies got revenge by pillaging her convent. In 1256 the Bishop of Liege established the Feast in one parish in his diocese, but died the same year. The convent was again pillaged. She was calumniated, forced to leave the convent, wandered during the last 20 years of her life, and died at age 66 after fruitless work for 50 years. Finally Pope Urban IV established the feast a century after the start of the revelations.
  
  Yet not always do such things happen. St. Catherine Labouré had early success with the Miraculous Medal.
  
  (h) Has the recipient been fearful of deception, open to Superiors or Director, and never desired revelations? St. Teresa of Avila was told in a vision to found a reformed Carmelite house, but yet did nothing until she had consulted four advisors (Autobiography 32). Mary of Agreda is quite the opposite. St. Ignatius in his rules for first Week, 13, says satan tries to keep the person from being open. St. Monica as St. Augustine reports desired revelations about his coming marriage; they were false (Confessions 6. 13). So if a revelation has been desired that alone makes it doubtful. This is especially so if answers of pure curiosity are desired or answers to scholastic questions. Mary of Agreda was imprudent here, and was encouraged in imprudence by her confessors.
  
  (i) It is probably good to employ the testimony of expert psychologists as to ecstatic states etc. However, psychology is not so solid and exact a science that absolute trust should be placed in their results. - Private Revelations