A good character flaw can enhance every element of your story. Flaws create risks and conflict. They lead to decisions that raise the stakes. Ultimately, a powerful flaw will reveal character and provide depth to the story’s theme.
The easiest place to begin looking at flaws is with your villain. Obviously, if nature is an antagonist, this won't work. And it won't work if some faceless organization takes the place of the bad guy. So think in terms of an individual with bad intentions.
This has to be someone who has some strong points. Most villains that catch our interest are intelligent. Some have clear (though often twisted) virtues.
Okay, do you have a villain with redeeming features in mind?
This one should be easy. Your villain needs to want something desperately. Unless they are (uninteresting) sociopaths, they need something and have a reason why they need it. In fact, they may even have justifications that make sense.
So now you have a villain with positive traits who desperately want something for what he or she believes are good reasons. I'm interested already. Now comes the fun part — give the villain a flaw. Not a simple vice. A villain may park in handicapped spots, but he or she needs more than that. Greed is good. Lust can be effective. Murderous rage always leads to (delightful) trouble. A good definition of a strong flaw is something that creates havoc in almost any context.
Now think of three things a villain would do in your story. If you can, make them essential tasks. And go beyond normal limits. Make these actions as extreme as you dare.
By now, you should have a potent brew of bad intentions, self-justification, a flaw, and evil actions. If you're like most people, you probably had some fun sticking your toe into the deep waters of the dark side. It's time for me to ask you to do something difficult. Give your hero as much of what you've just developed for the villain as possible. In particular, give your hero the villain's flaw.
That's got to hurt. And it will leave a mark — on your readers as well as you. But it's not as crazy as it sounds. Most writers identify too closely with their heroes and give them namby-pamby flaws nobody cares much about. Killing any prospects of having a powerful character arc in the story. They don't like their heroes to make mistakes or do bad things. They worry that people will not be able to identify with flawed heroes. This is nonsense.
This exercise takes advantage of the ease with which most writers can attribute evil to villains. Interestingly enough, this often leads to them giving all the best parts of the story to villains. A classic activity by some actors playing heroes is for them to mark the best lines in the villain's dialogue and ask that they be given to the hero (adapted as necessary).
If you do this exercise often enough, it will become easier for you to give your heroes the flaws they need to act with true heroism. Courage is not doing something dangerous. Often, that's foolhardy behavior. Courage is doing the right thing when you're terrified.
Have some courage here. Take on this challenge and make your hero work harder to get to a happy ending.