This question lies at the heart of romance. It’s a delicate dance between two people that, when conducted perfectly, ensures that neither person really has to say anything to let the other know just how valued they are in their lives.
I don’t recommend just asking, at least, not at first. Instead try to get a feel for how they’re acting and their emotional state when they are around you. You can learn a lot just by watching and listening.
If you create a quiet and supportive space where you are alone with them and they don’t have anything else to talk about, generally you can take whatever they say next as an allegory to how they currently feel about you.
You may not have intended this question to be considered in a romantic context, but the only time in which it’s really appropriate to try to sense how someone thinks about you is in romance. In every other context, then the right move is to figure out how to ask verbally. A lot of times this boils down to just nutting up and asking them. Sometimes you want to put a little care and delicacy into your question, but still, the amount of care involved shouldn’t be too great.
Even in romantic contexts, it’s often just too much work to put in to try to gauge feelings non-verbally. If you don’t have the time to create a safe space and gently coax the feelings out, try just asking. You’ll only be thought of as insecure if there’s a pattern or if the other person is so immature that they hold onto such childish ways of judgment.