An author has to pay as much attention to creating the perfect villain as on the protagonist, maybe even more. Because nothing makes you root for a character more than him having a worthy opponent. What would Sherlock be without Moriarty?
Most often, the problem is that authors create the villain, a truly evil person with the looks to match. Devilish eyes, always dressed in black, of course he is a cruel vile being. WRONG! The villain is the second most important lead of a story and needs to be just ad complex with all qualities that the protagonist has in reverse.
He also needs a back story. What made him the way he is? What are the reasons behind his evilness? No one is just simply cruel. And the reason that he does bad things should be justified. Put yourself in his shoes; understand your character and his reasons. Think of a revolutionary idea, something unique that distinguishes him.
Everyone has a dark side. To write a perfect villain, you will have to venture into yours. Those villains are just a personification of your own dark thoughts that you have learned to control. Every bad choice that you have stopped yourself from making, every time you controlled your anger, pour it into the character.
A villain is just a bitter and angry person who is incapable of maturing and changing because of terrible things that have happened to him.
Your antagonist needs to be as strong, capable and intelligent as your protagonist, maybe even more to make the triumph look actually heroic. Moreover, the tension between the protagonist and antagonist needs to be strong and constant. Sometimes, that happens when the both are elated through a bond of friendship, family or just having similar circumstances.
Don’t just spring up the villain right in the end to just move the plot. Either make his presence known somewhere after the beginning or have him work beneath the shadows, pulling strings, making things hard for the protagonist. Also understand that your antagonist is also human, make him more three dimensional, give him reasons for his evilness and show a time when he wasn’t evil. That would create sympathy among the readers along with understanding.
In the end, just AVOID typical villain dialogues. They are a cliché that have been overused since forever. Do something original, write uniquely. Additionally, like the protagonist has one distinct quality, the antagonist must also have it.