Stories about ghosts with a warning are rife. People see these phantoms at the foot of their beds at night, or in dreams.
There’s an apocryphal story that has been told by so many that it may well be true. People see or talk to someone and then learn later that the person had died prior to that contact. This kind of ghost may be many things. An actual spirit of a departed friend, coming to say goodbye; an image of the friend from the viewer’s subconscious, due to an episode of ESP regarding the death of the individual; or, an image of that friend from the viewer’s subconscious (coincidental). The coincident angle is a tenuous one, though.
There are stories of ghosts of loved ones, awakening people to warn them of danger. It always turns out that the encounter is just in the nick of time, and results in saving individuals from a sinking ship, a fire, or some other disaster.
These ghosts are interesting: are they actual spirits of the departed? Or does the individual’s mind somehow sense the danger, and create a phantasm to get the warning across in an effective way? For that matter, is a phantasm a ghost? If it is a creation of the mind and not a departed spirit, is it any less ghostly or (since lives were saved) miraculous?
(from About Ghosts: A Useful Handbook by Jan Olandese) https://www.amazon.com/Jan-Olandese/e/B071FK9L75