If what a person is doing is legally allowed, it’s not unlawful. An example of this would be that a officer simply walks up to someone and starts speaking with them. This would be termed a consensual encounter. They’re talking and the person decides to walk away from the officer. Given that the person hadn’t done anything wrong, they’re free to leave and this would no be resisting arrest.
However, it’s important to note that if you’re stopped lawfully, and then you run and the officer requests you stop and you keep on going this would be resisting arrest.