Citronella & spray collars and ultrasonic collars are very humane methods of teaching your dog to avoid unwanted behaviors, particularly barking.
Spray collars emit a harmless spray that does not create any fear of pain. Ultrasonic collars emit a beep that is inaudible to you but distracting to your dog.
Both types of collars are activated by your dog's barking, so they function automatically with no intervention by you.