As with any animal; human, dog or other, reinforced behaviours are more likely to be repeated. What does this mean exactly? It means that when we reinforced or rewarded for a particular behaviour, we are more likely to do that behaviour again, because we have previously been reinforced or rewarded for it.
For example, a dog that jumps up onto the bench and manages to steal a sandwich, is much more likely to jump up on the bench again because he knows there is the potential for reward. A dog that jumps up on the bench and finds nothing, is much less likely to do it again because there is no history of reinforcement or reward. A human that goes to work and gets paid, is much more likely to go to work again because there is a history of reinforcement and reward! A human that goes to work and doesn't get paid for it, is a lot less likely to show up for work next time.
Of course there could be other forms of reinforcement. Perhaps the bench is comfy for the dog to lie on, or gives it a good vantage spot to look out the window. These are both forms of reinforcement and so would result in the dog continuing to jump up on the bench. The human could find their work extremely rewarding because they enjoy it, and so may still continue to show up for work despite not being paid.
So what does this all have to do with teaching your dog to be calm? Well like I said, dogs are more likely to repeat a behaviour that has been reinforced. More often than not, most of the reinforcement for our dogs occurs when they are excited. We show them affection when they greet us excitedly after coming home, we feed them when they are dancing around asking for dinner, we take them for a walk when they appear to have too much energy, we play with them when they are feeling playful! And whilst none of these things are inherently bad, the biggest issue is that when our dogs are calm and doing nothing, we ignore them! What this means is that being calm brings little to no reinforcement, whilst being over excited or playful or energetic brings lots of reinforcement! Therefore, it's hardly surprising that our dogs then repeat these highly reinforced behaviours!
So in order to teach our dogs to be calm, we must reinforce it! When we come home, instead of rewarding our dog's initial exuberant greeting, wait until your dog is calm before saying hello. If you know your dog starts asking for dinner at a specific time, then get your dog's meal ready well ahead of time, and just before your dog starts asking for food, and they are lying down calmly having a snooze, go and surprise them by putting their meal in front of them! You have just given them a giant reward (an entire meal) for being calm!
Of course, whilst these small changes will make a difference to your dog's behaviour, there is still more work to be done! The first step to teaching your dog to be calm in any situation, is to first teach them to be calm in and around your home. What you will need to do this is a pocket (or a treat pouch) full of treats. Use healthy treats as you may be using a lot of them, and make sure you take this into account when feeding your dog their regular meals so they don't become overweight. If your dog is very food motivated, you can even use their regular food as treats.
When you are at home with your dog, every single time you see them lying down calmly, go and drop a treat in between their paws and walk away. At first your dog may follow you to see if you have anything else to offer, but just ignore him. Soon he will learn that following you isn't reinforcing. If he stays where he is, go back and reward him when he is calm. This way, he is rewarded for not only being calm in the first place, but remaining calm. Pretty soon, you will start to notice that your dog chooses to just lie down calmly more and more often. Note, if your dog is staring at you whilst lying down, don't reward. It is likely that he is staring at you because you have food. Rewarding him in this state could build food dependence.
Once your dog is choosing to be calm in the house and yard a lot of the time, it's time to introduce this game into the outside world! Remember, when working outside, you may need to use a higher value reward like real meat! Have your dog on their harness and lead. Find a quiet area, whether it's just outside your house or a nearby street. Stand (or sit) and wait your dog out. At first they may be excited, thinking they are going on a walk, however, soon they will get bored of waiting in the one place. As soon as they lie down and relax, that's when you reward them by dropping a treat in between their paws! At first, they will likely get up again, but just ignore this and wait for them to lie down and relax again, and then reward again. Soon they will start to maintain being relaxed.
When your dog is readily and easily relaxing in this quiet area, it's time to introduce distractions. It helps if you have someone you know helping you out, as you can set up the distractions at a distance at first, and have them gradually move closer. The distraction could be another person, or another dog, or a kid on a skateboard etc. Start at a distance that is easy for your dog, and again, wait for them to lie down and relax. As soon as they do, reward! Practice, practice, practice! Keep practicing and gradually build up the level of distractions and work up to being in busier places like the cafe or a sporting field. What is helpful is if the dog can learn the exercise in context, without distractions first. Try heading to a cafe outside of opening hours when no one is around and practicing the exercise first, before working up to sitting at the cafe when it's busy and full of people.
Tip: When working on this exercise, don't ask your dog to lie down. It's much more effective if you wait until your dog is actually relaxed and lies down on their own as opposed to just lying down because you said so :)