For more severe cases of separation anxiety, you can do all of the above techniques combined with a process of desensitization meant to get your dog used to being alone. This process should begin with your normal departure activities, things that your dog recognizes like getting the keys, putting on your shoes, or grabbing your coat. Do these normal activities, but then sit back down. Repeat this exercise until your dog does not respond to your actions with distress.
You then want to gradually increase what it is that you’re doing. The next step is to do your normal departure activities but then go to the door, open it, then sit back down. After that, increase what you’re doing so that you actually step outside, leaving the door open, then return and sit back down. Finally, increase it so that you step outside, close the door, then immediately return and sit back down. Slowly increase the amount of time that you’re outside so that you get your dog accustomed to being alone and being calm.