The main character is known as the protagonist, while the opposing character is known as the antagonist. Side note, protagonist and hero aren’t synonymous. Your main character could be a villain, morally gray, etc. Antagonists aren’t always evil. Sometimes it’s the fact that they’re opposing what the protagonist wants to do, which could be good or bad.