Every character in your story should have a clear motivation. They need a reason to enter the scene, and something they want to accomplish before the scene is over. This goes for a walk-on character who only has one line just as much as it goes for your protagonist and antagonist. If a character has no reason to appear in a scene, then they shouldn’t. Give them something to do!
This might seem daunting at first, but it’s simpler than it sounds. There are only three main motivations: love, money, and death. These are the things that drive people, and attaching one of them to a character is all you need to get them moving.
This isn’t to say that character motivations can’t be nuanced. In fact, these three poles of motivation are what create character depth–and in fact, give your whole story dimension. Imagine, say, a character who feels like they’re not getting fulfillment from their job. That’s simply a character who is feeling tension between the fear of death (that their life will have no meaning) and the desire for money (hence the unfulfilling job). This character might be motivated to quit their job and find more interesting work (that’s a pretty good plot hook), or stick around for the paycheck and grow ever more miserable (which could inform the tone, or create conflict with other characters, or affect their relationships and therefore rope in the motivation of love…).
For most characters, and most stories, you probably want to stick with just one level of complexity here. Pick two motivations, tops, and put them at odds with each other. If other motivating factors come into play as a result of that tension, fine, but don’t dwell on them, or your story can lose focus. That’s for top-level characters, mind you–people who get a lot of lines of dialogue and are intrinsic to the action of the story. Minor characters are usually best given just one motivator. Someone who walks on page just to deliver a crucial piece of information, then never appears again, shouldn’t have a massive backstory. Maybe they’re just doing their job (money) or just wanted to help a protagonist they secretly love… you get the picture.