Dear friend in Christ,
An early Halloween-inspired question!
The Church has not pronounced definitively about the existence of ghosts one way or the other. There is nothing in the Catechism or the Code of Canon Law about ghosts so we turn to scripture and tradition.
In Luke 24:39, Jesus tells His disciples “Touch me and see, because a ghost does not have flesh and bones as you can see I have.” Also, for centuries the Church referred to the Third Person of the Trinity as the Holy Ghost. These would seem to indicate, at least in an implied way, the existence of ghosts.
What we do know for certain is that God permits the spirits of deceased human beings to come back (from Heaven, Hell or Purgatory) to relay messages or warnings or announcements to people still alive on earth. Catholic tradition is filled with thousands of examples of this. If this is what you mean by ghosts, then, yes, ghosts are real.
In terms of the more “Hollywood” version of ghosts, it’s possible. This is why praying for the dead is so important. Sometimes they simply need prayers or Masses said for them.
We should NEVER attempt to summon the dead or contact them through mediums, psychics or fortune tellers. This can have horrifying consequences. We can communicate easily with our deceased loved ones at Mass, in which all the souls of Heaven participate.