Characters are a huge part of what makes a story convincing and interesting to read. The characters in a story have to be believable, or nobody will take them or the story seriously. They can't be all good or all bad, because both exist in everyone. It's hard to balance these qualities, or at least make sure there are redeeming qualities about your antagonist and less-than-desirable qualities in your protagonist. (This makes them complex. Readers like that.)
Let's start with the protagonist. They're probably the first character your readers will meet in the story (unless you just decide to really shake things up, which is totally fine as well), and generally the point of the protagonist is for the reader to like and identify with them. Obviously the protagonist will often be inherently good, but if there’s nothing “wrong” with them, they won’t be all that relatable. Your protagonist shouldn’t necessarily have an overwhelming fatal flaw that causes the downfall of an empire or anything, but there should be something to prove to the readers that the character isn’t perfect. Give your character a slight temper, impulsive decision-making skills, stubbornness, or something along those lines. Everyone deals with issues like that at some point, so it’ll make your character easy to identify with. Make their imperfections a part of your character and a part of your story.
Relatable characters also grow. Many times, once a character has established their personality it’s hard to want them to change. But without change, where would the story be? A character should learn from the things that happen to them, and they should change in some way because of that. There should be some revelation or a series of small happenstances that cause the character to rethink something (or several things) and change their ways. Most of the time this isn’t a 180-degree lifestyle change; but it’s something that is significant enough to be noticed by others. Flat characters never learn anything, and readers can’t identify with flat characters. There are really no restrictions on what the character has to endure in order to grow and develop, and as long as the character learns something or changes somehow through the course of the story, you can avoid writing a flat character readers won’t want to spend time with.