Start with the dog walk
The first step in the process is to take the dog for a long walk. This will help teach her to trust you, as well as use up excess energy, which will reduce her anxiety. If she does eliminate, give her immediate praise or a treat, and continue to do so whenever she does her business on the walk.
Don’t worry if your dog doesn’t get it right away. If, despite a long walk, he still hasn’t gone, return home and then watch. As soon as you see signs that he may be getting ready to do his business, such as sniffing or circling, immediately take him outside, and repeat the treat/praise routine when he eliminates outside.