Okay based on additional info offered, if I am dealing with a child (my own or one I watch) at this age, I go to the child, stoop to their level to speak & if they are still trying not to listen I gently but firmly hold the upper arm & give a slight tension toward the floor. This should be very very gentle. It is in no way meant to inflict anything uncomfortable, but rather it's a weird thing (have your spouse do it to you) and it will get them to look at you, every time. My kids aren't even annoyed by it, as it's not meant to annoy. It's merely a way I have sorted actually gets an attention response. I am only holding enough tension to be able to slightly drop that shoulder a hair. I do not think you would read this wrong, but for the sake of anyone reading, NEVER pull a child's arm or squeeze. This is not that.
If that were to fail, then I pick up the child & remove them to a location where there is less distraction. I try to keep whatever I say to as simplistic as possible and I try to get them to repeat it to me so that I know they heard it.
I have no example from you, so I will just make one up. My 3 year old can be too wild say on someone's furniture. I will go over & remove her if she is on it, get down to her level & tell her that she cannot climb on their sofa, that she can climb on her swingset at home, then offer her whatever best option to occupy herself that I have. If she isn't listening to me in that time I will try holding the arm to get eye contact, if that isn't enough, I will pick her up & take her to the bathroom. If again, that might be too much (she loves sinks, sadly) then I may take her to my car briefly. If instead it was running in a store, I'd simply cart her. She will hate it, as she does & I will say something like "I am so sorry you are still having a tough time walking with me. I hope that soon you can walk nicely so that you don't have to stay in the cart for safety".
I never tell her anything is naughty, instead I try to identify what needs to happen to get what she wants (walk nicely, stop climbing) and if she unable to do it, then I empathize that it's basically stinks that those are too hard for us right now, so it looks like we have to take options we don't like (such as go home, put a toy away that isn't played with nicely, ride in the cart instead of walk). And if it's likely due to needing sleep or food, then I also note that. "I am so sorry I brought you to the park when you were too hungry. It makes it hard to play nicely when we are hungry. Now I will take you to go get some food & next time we come I will make sure it's better timed". A lot of that too is to help her learn to self identify problems & give them labels that can help her (and me) avoid such issues. If she starts to figure out that being hungry makes you a tyrant, then she can learn that when she feels like a tyrant she can self evaluate if she may be hungry, tired, etc & then do something about it. She won't at 3. It's not going to happen, but you can hope that by 5ish she will start to be able to tell you such things. Also this is an age of getting over stimulated often. I find sometimes that I have to be watchful to notice the change in behavior when it hits & pack up & go home. I do not think they can process too much commotion for too long or all of them start to fall apart in their own ways. For some it will be whining, others will have terrible bedtime later, some will start being aggressive, others start into that running away while laughing when you aren't finding it the least bit funny. Building in down time can help too when going home isn't an option (like on vacation or the like).