One way is by playing on our primal fears. Fear of the dark is a big one. Haunted house stories often set the scene at night. When it's dark, we can't see clearly, and our minds fill in the blanks with all kinds of terrifying things. Also, the fear of the supernatural. Ghosts, demons, and other entities that go against the laws of nature are very scary. In haunted house stories, these entities often have malicious intentions towards the people in the house. They can possess people, cause harm, or drive them insane, which is really frightening.
Haunted house horror stories create fear by building suspense. They might start with small, unexplained events, like a door creaking open on its own. Then, as the story progresses, more and more disturbing things happen. The anticipation of what will come next makes the reader or viewer scared. For instance, in 'The Haunting of Hill House', the characters keep experiencing these little oddities that gradually build into full - blown horror. Another way is through the use of atmosphere. Dark, gloomy settings with flickering lights and cold drafts add to the sense of dread. When a story describes a shadowy corner of a haunted house where anything could be lurking, it makes the audience's imagination run wild with fear.
They often use the unknown. For example, in many stories, there are strange noises at night. You don't know what's making the noise, and that scares people. Also, the idea of something being wrong with a place where you're supposed to feel safe, like your home, is terrifying.