The first important element is the mood. You have to create a sense of dread and mystery from the very beginning. You can do this by using words like 'dark', 'eerie', and 'forbidding'. The second element is the characters. They should be relatable enough so that the audience can put themselves in their shoes. And the third is the climax. It should be both scary and unexpected, like the sudden appearance of the ghost right in front of the protagonist.
In telling a good ghost story, atmosphere is crucial. You can build it through the description of the environment, such as a decaying mansion with cobwebs everywhere. Characterization also matters. A well - described ghost with its own motives and backstory makes the story more engaging. And the pacing is essential. You can't rush through the story. Let the tension build slowly. For example, start by casually mentioning a strange occurrence, and then gradually increase the intensity until the big scare at the end.