One thing writers try to do is ‘show’ a character by his or her actions. That is, rather than say,
Bob Jenkins was a bad man.
You show it by
Bob Jenkins pulled into the petrol station one midnight, just after Granny Stevens had closed up, and demanded she unlock one of the bowsers so he could fill up. Granny refused, so he punched her in the face, knocked her to the ground, and drove off. Granny spent three months in hospital, recovering.
It’s not so common now, but simple way authors were taught to show a protagonist’s character was to show how he treated animals.
Does he kick the dog, or does he pat it? Does he, like Jack Holloway in John Scalzi’s Fuzzy Nation, allow his dog to detonate explosives. (This works better than it sounds here, Jack’s relationship with his dog saves him, in my opinion.) Or does he, like Riggs in Lethal Weapon, rescue a dog that’s being tortured by some low-lifes?
That last may or may not be true, but I’m sure I’ve seen the start of Lethal Weapon where some people are sitting around a fire in a drum, and they’re torturing a dog. Riggs is uber crazy, out of his mind with grief and depression, probably blind drunk, and he goes in and tears these people apart. (Not literally, but he roughs them up.) It sets the scene for the whole movie. People I’ve spoken to can’t remember the scene, so I don’t know if I imagined it or not. But to me, it’s part of the Lethal Weapon canon, and it shows Riggs’ character perfectly. He’ll go in to prevent injustice, but he’s badass with it.
Like I say, they don’t use animals as much to show character now, although it’s still around.
Another common technique was to show how the character treated children.
Nowadays, good guys can be a lot more ambiguous, but they have to have morals. Morals that we agree with.
Even if they’re half-way bad, our ‘good guy’ has a good reason for doing something. Something that we as a reader think is a good thing. For example, our protagonist may be determined to destroy a pharmaceutical company, and does unpleasant things to achieve it, but it always turns out that the company he (or she) is trying to destroy is worse. For example, they covered up the test results of a drug they sell, and even though they know the drug causes people to die screaming in agony they still sell it, because it makes them money. Enough money to buy and sell governments.
I love bad guys who aren’t truly bad, just doing what they feel is right, and that’s different to what the protagonist wants. They’re the best type of ‘bad’ characters to read about.
Even so, my gut feel is that with the world in the turmoil it is today, many writers will start making their antagonists a little more obviously bad in the future. It’s a way of coping.