Some dogs dig instinctively and when they develop a habit of digging it can be very challenging to train them out of it. When you first start the process of breaking the digging habit, make sure your dog is getting plenty of exercise and is never left unattended in the yard for any reason. Invest in a kennel to keep your dog in when you are away from the house. Ensure the kennel is the proper size for your dog. They should be able to stand up and comfortably turn around in it.
Designate a place for your dog to dig, such as a sand box. To attract your dog to the designated area, regularly toss and bury some milk bones (or other treats!) in sand as this will encourage them to dig. When your dog digs anywhere else immediately tell them “no” sternly and redirect to the sandbox. It is extremely important to catch your dog EVERY TIME they try and dig outside the sandbox and redirect them to where they are allowed to dig.
Go out of your way to praise your dog and make sure they know you are proud of them when they DO dig in the sandbox on their own, or when you encourage them.