Stopping troublesome dog behaviors is often a matter of understanding what is contributing to the behavior in the first place. Are you at the point of screaming at your dog to stop digging? Do you reprimand your dog for digging hours after the crime has been committed?
Learning how to stop a dog from digging involves understanding why your dog has dug in the first place. Dogs dig to relieve boredom, to create shelter, to bury leftover food, and to escape. All of these motives are preventable and should be limited as much as possible by the responsible dog owner.
It is important to remember that digging is a normal dog behavior, and is more deeply engrained in some breeds than others. The most troublesome breed is, to no surprise, the Terrier Group, whose name actually comes from the Latin for "put to earth." This should tell you something about this kind of dog! They can be very rascally and, rather than seeking to stop their behavior altogether, you should only aim for a compromise.
Thus, you need to meet your dog's digging instincts halfway and provide an area where it is acceptable for your dog to dig. Use sand or loose earth, and encourage the dog to dig only in that spot by burying treats for it to discover. Reward its efforts with praise for digging there, and use a consistent command to stop digging in other areas. To distract your dog from digging in unsuitable areas, show him a toy and lead him to the proper digging area. Once he begins to dig in the correct area, PRAISE HIM IMMEDIATELY.
If a dog is digging to create shelter from the cold, look at providing an insulated doghouse, or a pet door that is always accessible for getting in and out of the house. When the weather is hot, make sure adequate drinking water is always available to help your pet regulate their body heat. Digging is likely a shelter issue if you see them lying in the holes they have dug out. This is a natural behavior for dogs that comes from their days in the wild, so accommodate the behavior by removing the need for them to dig shelters in the first place. Provide a small wading pool for the dog to cool down in, or a special shaded area.
Boredom is another common reason for digging. Dogs need stimulation and activity, and will do what they can to entertain themselves if you do not provide adequate opportunities. Make sure your pet gets taken for walks regularly, arranging for someone else to take them if you are not available. Engage them in games, with a ball or Frisbee. AVOID aggressive games like tug of war or wrestling, which encourage chewing and biting.
While you shouldn't spoil your dog with affection unless he behaves well, make sure you do give it enough attention so he doesn't feel the need to engage in attention-seeking behaviors. If they do develop annoying or destructive habits, remember that even negative attention from you is still attention, and this may be what they are craving.
Therefore, prevent chewing before it becomes an issue simply by showing your dog some love, spending quality time with him, and exercising and mentally challenging him. Finally, remember to discipline him correctly. Physical or verbal punishment is rarely an effective strategy to stop your dog from digging, and should be avoided. Instead, make it clear what is and isn't acceptable, and be consistent in reminding your dog of this.