I know it comes across as a cliche these days, but I really do just look at their motivations. If we’re speaking of relevance within the story, I ask myself “Why is this character here in this place, making these decisions or going through these things?” If I can’t answer that question, I go back to the drawing board. I either drill down until I can find their connection to the setting and story, or I remove them from the equation.
When it comes to depth, I often give them one outward motive and one inward motive. One thing the reader can grab hold to, and the other bubbling under the surface, driving their “why.”