I can think of three ways to go about this.
The first and more popular is to make the villain still a "good guy". For example, he may be the demon lord, but the humans he kills are assholes anyway. The monsters are actually the oppressed ones. He may save a slave or two (or many) along the way. Essentially, he's just a reskinned hero. The reason this is popular is that web novels are primarily written for reader self-insert, and most people do want to be the "good guys" with a different flavor sometimes.
The second way is to make the hero an actual villain, like he kills innocent people and all that, but he has a reason for it. (Doesn't have to be a good reason). Usually, these are the revenge type of stories. Also very popular, probably second to the above. Revenge plots are very cathartic for reader self-insert. Plus, even if the MC does bad guy things, they can wave it away with justifications.
The third way is to write an actual villain with no reason--this one isn't for reader self-insert. This way can actually get you some hate, maybe not here on SH since most people are nice here, but in RR definitely will invite some pushback.
While I did mention three "ways" this is more of a spectrum. When doing something for webnovels, the gauge is gearing for most reader self-insert to none. Do note that the further away from being a "general" self-insert story you are, the harder game you're playing.