Try these strategies:
1. Desensitization and counterconditioning to departure cues.
2. Muzzle training to prevent barking while allowing comfortable breathing.
3. Distraction with treats or toys.
4. Ensure adequate exercise and mental stimulation.
5. Train a “quiet” signal.
6. Soundproof areas where barking occurs.
7. Use alternative exits your dog doesn’t associate with leaving.
Training takes time and consistency. If the problem persists, consult a qualified dog trainer or behaviorist.