The modern concept we have of vampires came from the movies, which mostly came from the 1897 novel Dracula by Bram Stoker. The legends of vampires that go back hundreds of years in Europe were more like pop culture zombies. They were dead people who rose from their graves to kill the living. (As an aside, the term zombie came from Haitian tales of people who were resurrected and kept as slaves even after death. Our modern idea of zombies was cemented by the 1968 film Night of the Living Dead.)
Hundreds of years ago in Eastern Europe, death by mysterious means was rampant, due to wild animals, disease, and murderous bandits. Vampires were an explanation for many deaths, assisted by the strange way some human bodies decompose. The natural response to vampire fears was to bury the dead with insurance against their return, such as driving a stake through the body. When that didn't work, bodies were exhumed to further curb their powers. Besides the legends, we have archaeological evidence of defensive tactics against vampires. Read about those practices and the legends that spawned them at Mental Floss.
(Image credit: Edvard Munch)