In many people's minds, darkness is associated with evil, while light is associated with good. It's not just colors and shades, either - spooky imagery like shadows and bones, and demonic attributes are all considered signs of a nefarious personality.
Dark anime heroes flip this notion on its head. Sometimes, these characters' aesthetics aren't meant to be transgressive - it's just that traditionally speaking, Japan has different associations with colors like black and white than the Western world does. But in many cases, these characters are meant to be ironically designed. Some of them are anime heroes with dark powers, like Fumikage Tokoyami from My Hero Academia, who controls a sentient bird-shaped shadow that lives in his body. Others, like Umehito Nekozawa from Ouran High School Host Club, simply don a dark aesthetic without boasting any particular powers.
Which of these spooky anime characters are your favorites?
One wouldn't exactly expect a hero-in-training to wear all black clothing, talk constantly about the power of darkness, and have a bird-shaped shadow in his body that grows more powerful in the darkness, but that's Fumikage Tokoyami for you. Sure, he revels in both his quirk and his aesthetic, but that doesn't stop him from being a good-hearted kid who wants nothing more than to protect others.
Rin Okumura is the literal son of Satan, so one would expect him to be about as evil as it's possible to be. But because he wasn't raised by his biological father, and was instead raised by a demon slayer, he grew up with a strong desire to protect human life. Unfortunately, because of his background, a lot of people don't believe him and expect him to be on the side of evil.
If you're not sure what a Shinigami is, here's some info - it's literally a god of death. The Shinigami in Bleach ensure the safety of souls as they cross over from the world of the living to the afterlife, and they purify Hollows who are causing trouble for humanity. They dress in all black, carry weapons, and generally appear suited to their roles. While some of them aren't exactly kind or heroic, protagonist Ichigo Kurosaki definitely is.
Bleach takes the whole 'darkness isn't evil' thing even further by dressing bad guys like the Arrancar in white.
Asta possesses the prototypical shonen hero personality, which is anything but evil. Despite this, his aesthetic is super dark. Not only does he wear mostly black clothing, his anti-magic grimoire uses dark energy to function. What's more, he eventually starts using a sword that has a demon dwelling inside of it. That sword gives him an even darker appearance, casting a shadow over his arm and giving him a black horn and a black wing. Despite the bad guy aesthetic, he remains true to his shonen hero roots and dedicates himself to helping others.