Step one, paradoxically, is to teach the "off" switch for attention. Sit your dog in heel position, and encourage him to look up at you. Then use whatever word you're going to use for your release word (OK, Free, Niagara, whatever) and whoop, cheer, jump, encouraging the dog to leave the sit. Do this until the dog reacts just on the word. From now on, until the end of time, you must always use that release word when you are finished with an obedience behavior.
Step two is to teach the "on" switch for attention. This will be "Sit'" The ideal is that the second you say that, the dog sits, and focuses total attention on you for whatever comes next. Again, sit your dog in heel position. Use a tasty treat to encourage that head up and the eyes focused on you. You may need to actually position his head with your hands (left palm on right cheek, fingers facing toward the back of the dog, right palm on left cheek). Croon your praise, and after a few seconds release with big praise. Repeat, repeat, repeat, gradually lengthening the time. A very good sign that you are getting through is that the dog begins to automatically lift his head to look at you the second that he sits.
It is very important that you make it a rule from this point on that when your dog is in heel position, she must be paying attention. That means, though, that if she's in heel and the teacher is talking about something, or you get into a conversation with someone, you should release the dog and move away from heel position until you're really ready to work again. It's not fair to demand attention from your dog when you're not giving any attention back!
Once you feel he has this down, begin adding some distractions (people walking by, traffic passing) and help him if/when he looks away. But if you have helped repeatedly, you may need to use a mild correction (a quick pop up on the collar) to remind him of what the deal is. And remember to praise when your dog looks at you! When Boris successfully maintains attention on you despite a distraction, praise big, release and reward it! Break into a game, reward with a treat, but make sure that that positive reinforcement is a good one!
What if the dog has shown that he understands attention, but is choosing to ignore you? Then, dear friends, we go to the runaway. You can do a runaway from either a sit or when you are in motion in heeling. If your dog starts woolgathering at something else completely, you exit, fast, stage right, cheering wildly and happily as you go. Then just set back up in heel position, and continue with what you were doing. (Before you leave: grab the leash with both hands, and tuck them down at your waistline, arms and hands right next to your body. THEN right turn and RUN! Prevents shoulder and hand strain). Be perfectly cheerful the whole time! You may have to do this two or three times in a row to get your point across. But when you see your dog tempted to take her eyes off you, and just flicking them away but then right back, release her and praise, praise, praise! You're getting through! (And you have to make this a game that the dog can win!)
Once you have built attention at the sit, you can begin building attention during heeling, etc. Again, start at ground zero, and build in tiny increments. At first you might be demanding attention for only two or three steps before you release and reward. Then four steps. Then five. Yes, it takes time. But if you ever hope to step into an obedience ring, it's time well spent.
Obedience thought for the day: If you go to a trial, and your dog
does well, give all the credit to the dog. But if things go badly,
don't blame the dog. And don't blame yourself! Just step back, review
what happened, and try to figure out how to give your dog the tools
he needs to do better the next time.