If every story has a hero, logic follows that it must also have a villain. In writing, we call this character the antagonist. But because we are writers, we are able to make our villains as unique as we like. Your antagonist doesn't have to be evil or frightening. Hell, write it a certain way and it doesn't even need to be human.
Evil and Good
Your main character is your protagonist, and in any good story there will be plenty of conflict to keep your hero from their ultimate goal. Perhaps they want to gain someone's love, overcome some problem, solve a mystery -- whatever it is they want to do. Something is going to stand in the way of this goal. That something is the antagonist, or the villain of your story.
In some cases, the villain will manifest itself as another character in the story. Perhaps it's a rival love interest, or a detective who is also working on the case your character wants to solve, or even the criminal themselves. Some stories have more than one villain whom the hero must vanquish before achieving their goal (or failing).
When the villain is another character, the writing isn't as cut and dry as it seems. Some writers like to make villains sympathetic by giving them some admirable qualities or likable traits. This sets up a conflict in the reader that creates more tension. In other stories, the villain may be purely evil and unlikable (Voldemort is one example). When this villain is also seemingly unbeatable, this can also create a lot of tension and drama. Tension is the key to creating conflict, and another character is a great way to introduce it into the story.
But, you don't have to use another character as your villain. There are many creative ways to introduce anatogism into the story without creating villainous characters. The weather may conspire against your character, or an automobile. A car that breaks down at a critical moment can be an evil thing in any story. Sheer bad luck may be what plagues your character, or perhaps a physical limitation is their main antagonist. In some stories the villain is an animal, like a fearsome dog or a crafty cat. An entity or non-human creature also makes a handy villain. A terrible memory or some hang-up that your character has can also become a villain, setting up an inner conflict.
There are many different ways to introduce "evil" into your story. When it comes to the antagonist of your stories, think outside the box. Devote as much time to the antagonist as you do to the protagonist, and you'll create lots of rich drama.