We spent some time taking our Jack Russel to proper training classes when she was little, which i would definitely recommend. Terriers are reputed to be troublesome, but with a little training we got ours to a basic level of obedience (loose lead walking, not barging through doorways, sit and wait patiently for food, et cetera) within a few weeks.
Whenever i take her out i’ll have a pocketful of treats which she’ll get fed regularly; this is simply to reinforce the mindset that staying near to me is much more interesting than running off.
That said, when she hears the sound of children playing (her favorite thing to investigate) she’ll be off; whatever i do after that point is irrelevant. I just rely on spotting the interesting things before she can, so i can call her to me and put the lead on.