How do you keep your kids from running off in public?

Hey was just wondering if you have any ideas on how to keep kids from running off in public and staying with you my son runs off in public, and he does it at school to you have any ideas that will be helpful

Those back pack leashes. I know people judge a lot for those that use them, but if your child is a runner, they would be the safest option!