black hat
noun
• a bad person, especially a villain or criminal in a film, novel, or play.
• "we are the good guys—the black hats lost"
Origin:
1950s: from the colour of the hat traditionally worn by the bad characters in westerns. Compare with white hat.