Teach your dog to ring a bell when they need to go out, and you won't ever have to put up with undesirable behavior like scratching on the door or barking.
To train your dog, place the bell on or near the door. When your dog needs to go out, take them to the doorbell and ring it with their paw while giving a command, then open the door to let them out. Repeat this process, always giving the same command and praise, until your dog learns the behavior.
You'll be amazed how quickly your clever doggo learns this new trick!