you can teach your dog to bark: Then get a box of treats. Then look at your dog. When he barks, immediately praise him and give him a treat. Don’t let any time elapse between the bark and the treat. Pretty soon he’ll be barking a lot. Right now, the behavior is coming before the cue. Shape the behavior first, and then add your cue.
Teaching your dog to bark on command: Then go away for a few minutes and come back. Ignore his barking and ignore everything else he does. Just stand there, doing nothing, not rewarding him at all, not even looking at him. It may take a long time, but eventually your dog will calm down, stop barking, and start doing his own thing. Once your dog calms down and stops barking, start working with him again. This time, only give him a treat when you say “Speak” and point at him, and then he barks. 1. Verbal command and point. 2. Bark. 3. Reward. Don’t give him a treat for just barking on his own. This part will take a while, but he will eventually understand the command. You’re rewarding him for behavior he already is predisposed to do, you’re just associating a command with it.
you can teach your dog to be quiet: Go away for a few minutes, and then come back. He’ll probably be barking a lot when you come back, but again, stay totally still and don’t reward him at all (no praising, no eye contact, nothing). Once he stops barking, count to five slowly to yourself. You may have to wait a long time before he’ll stop barking enough so a full count of five, but it will happen eventually. Once you can count to five without any barking, then reward him with praise and a treat. Notice that at this point, the behavior comes before the cue. Shape the behavior first, and then add your cue.
Teaching your dog to be quiet on demand: Keep that up for a while until the behavior sinks in, and then add the command. When he’s not barking, hold up your hand as if you’re signaling someone to stop, and say the command “Quiet”. If he’s quiet, then give him a treat and praise. So the order is 1. Verbal command and hand signal. 2. Dog is quiet. 3. Reward. Soon your dog will know how to be quiet on demand.
The praise of a dog at irregular intervals is the intermittent reinforcement part of the picture, and is very powerful. Intermittent reinforcement works better than if you reward behavior every single time.