Training your dog to come to you on cue is one of the nicest things you can do for your dog. Knowing that your dog will return whenever you want her to allows you both freedom to play and go wherever -- within reason -- like the park or even a dog-friendly festival.
Training a recall, along with a solid "emergency down" may save your dog's life one day, so it's worth putting some time into training her to respond quickly.
So how do you train a reliable recall? First, choose a word for the cue. If your dog is a puppy, you can choose whatever you want, just stick to it. If your dog is a rescue, you might want to pick something out-of-the-ordinary as your cue. She might have bad associations with "come" from her previous guardian. Just test it out, and she'll tell you. If she ignores you, that's okay. If she runs away, that's a sign you should use a different word.
Let's assume that your recall cue is Come. If you have already tried (and your dog isn't responding to) Come, I'd pick a new word. Chances are, you've managed to poison the cue, somehow, and it's best to start fresh with a new word, with no associations. You want this to be one of the best words your dog knows. It means, "run to me, there's a party over here!" The idea is to never let your dog know that there is something better than coming to you. So never say "come" when you think your dog may not do it. The second thing to be sure that you do not do is doing something scary after your dog comes to you.
When your dog comes when you call her, do not do anything that she does not like. That might include nail-clipping, putting the leash to leave the park, or yelling at her for pouncing on the neighbor's cat. The last thing she did was come to you -- you don't want to punish that, you should reward it! You'll have to be satisfied with telling her, in a nice, upbeat voice, what a rotten dog she is. Finally, the last bit of negative advice is to never chase after your dog. You do not want her to think that running away from you is a fun game. Whether she has a sock, you need to take her out of the park, or you just think it's fun, chasing is not the answer.
The major steps in teaching the recall are to introduce the cue and then practice in a huge number of different circumstances. Vary how far away you are from the dog and how many distractions there are.
When you make one aspect harder, make the other one easier. You might use a long line for safety or as a gentle reminder of your existence, but don't use it to tug your dog to you. If you need the line very often, you are pushing her too fast. Set your dog up for success.
Step-by-step instructions for recall are in my online course: "Common Behavior Problems: Outside the Home."
No guarantee is stated or implied in this article and (while it should be safe, done correctly) if you follow any of the advice in it without supervision, you do so at your own risk. If you ever feel that you, your dog, or others are at risk because of your dog, please seek the services of a professional dog trainer.