The history sorrounding the use of garlic in deterring vampires is actually really fascinating.
First off, the smell of garlic was known to deter bats. Especially in southern America (which is the only place that vampire bats are native to).
So despite there being no actual blood sucking possible vampire, bats, in South East Europe, there was another reason to repel them.
On the rare occasion that someone would get bitten by a bat, they were pretty likely to catch something. Especially rabies, which was pretty prominent in bats in the 1800s.
Rabies itself was huge during the 1800s and early 1900s. It was epidemic and caused mass hysteria. And people didn't understand it.
In Dracula, Bram stoker's first descriptions of Lucy when she is being bitten every night are actually pretty consistent with early rabies.
The signs were, lack of appetite, headache and weakness. Which were often put up to hysteria.
In earlier renditions of vampires, they can also not cross running water, and more popularly do not like sunlight, which are both symptoms of late rabies.
*side note. Blood transfusions actually could have help reduce symptoms, and in some cases cure rabies. But only if you were lucky enough to get a transfusion off of someone who already had the antibodies.
So besides rabies, garlic is a massive antibiotic, and is actually effective against bacteria, fungi and viruses.
This actually originated from Egypt, garlic was thought to have magical healing properties. Often Egyptians were buried with garlic stuffed in their mouths, to prevent evil spirits. (Diseases, but could be interpreted as rising from the dead and being a vampire) .
So to conclude people. Eat your garlic.