I like to think that my dog training classes are actually dog teaching classes. What we do in a dog obedience class is teach basic commands to the dogs. (And their owners). The training part comes later, when the owners take their dogs or puppies home and go over the commands with them.
This, like the repetitions in a gym class or on a weight machine, is where the training comes in. There is a difference between teaching and training. When you teach, you are instructing a dog (or person) to do something that they don't know how to do. When you train, in a dog obedience class situation, you take that behavior and repeat it until you get it right.
This is why I tell my students not to overdo their training sessions. You don't want the dog to become bored with his tasks. Once he learns his commands and responds appropriately, don't keep going over the same old thing. Mix it up a little. If he does a down stay with you a few feet away, it's time for him to do the same down stay with you 10 feet away. Or, with someone bouncing a rubber ball around him.
Use the act of training as it is intended. Just like the athlete who keeps increasing his time, weight or distance, increase the difficulty of the session, always challenging your dog in order to keep him interested.
Don't make it too hard. You don't want him to get frustrated and give up. Increase his time, distance or difficulty, a little bit each time he perfects a behavior. This keeps him focused, having fun (because he's getting a lot of praise for doing it right) and it keeps him motivated.
So, what happens when you know he knows how to do something but he just refuses to do it? Take him back to the simpler exercises. He may need more praise. Show him that when he does something right he gets a lot of praise (and cookies, too). Let doing it right be its own motivation because he gets so much praise.
If he still doesn't want to do the behavior, then it may be time for a reprimand. But, a reprimand and punishment are two different things and should never be confused in a dog training situation. There is never a call to punish a dog in a learning environment. A simple reprimand is the word "no." Not said harshly, loudly or with force. Simply, "no." Period. Then go over the stuff you know he does well in order for him to achieve success and the praise that goes with it.
Soon, he'll see the difference - don't do it right, get "no." Do it right, get praised! Maybe even a cookie! It won't be long before he's always doing it right.