It might not be possible to test ghosts using scientific tools even if ghosts did truly exist. But there are other ways to investigate strange things.
One way is to ask, “How did this idea get started? What form did this story first take—and how did it change over time?” Sometimes history can give us clues about the truth of a claim even when we can’t test that claim directly. For example, if a person today said they spotted a “one-eyed, onehorned, flying purple people eater,” the history of popular music would give us an important clue that this sighting was likely made up or imagined: flying purple people eaters are make-believe creatures created in the 1950s for a famous silly song.
In the case of ghosts, however, even the historical approach is a bit tricky. People have told tales of ghost encounters and haunted places for a very, very, very long time. Ghosts swarm through the oldest stories known to exist! We don’t know how the first ghost beliefs got started or what form they took, because it happened too long ago—probably long before writing was invented.