Shock collars don't usually work.
They use a microphone to associate a noise with a command from a tiny computer chip inside, connected to a battery, connected to a wire that is touching the dog. When the microphone "hears" a bark, it sends a command to the chip, that is sent to the battery, that sends a pulse of electricity through the wire, that shocks the dog.
The only problem is that most collars are designed to know what a bark sounds like from any breed of dog, and microphones are pretty bad at knowing where a sound came from. Whenever the mic hears a bark, coming from anywhere, it shocks the dog. This can mess with your dog's mind, because animals think very simply by associating good and bad with certain things. You hope the dog thinks bark=shock, shock=pain/discomfort, pain/discomfort=bad. But when you have other dogs around, they might be barking as well, so not only is the dog being shocked for itself, but for others too.
Animals think like this: good=do it again bad=avoid at all costs. As you could imagine, the shock from the collar goes into your dog's mind as bad. If you do choose to do a shock collar, please prepare to put up with the guilt of the living hell you'll put your dog through for no reason.
I looked even deeper and found an article that said and I quote "Shock collars can cause dogs to be afraid of their owners, and in severe cases, can even cause damage to the vocal cords." According to a news site I confirmed was credible, AP news, " From time immemorial, human beings have been under the impression that mammals that live among us -- from horses and cattle, oxen, sheep and goats to cats and dogs -- needed mistreatment to do what the humans wanted them to do."
"Yes, that is an appalling declaration, but it’s sadly true in so many regards. Shock collars or “e-collars,” are typically used for the alleged purpose of controlling a dog’s vocalizing (barking) or as a “tool” for other training."
Instead of a shock collar, I'd recommend something you do yourself, like if your dog is trained, you could tell it to "stop" when barking. If not, do something you know your dog dislikes (good examples would be tap in a place your dog does not like to be touched, like the snout or between the eyes) be sure to be careful when doing so because every dog is different. For example, my dog stopped barking when I lightly tapped him on the nose, but he is trained, so he knew exactly why I was doing it, your dog might not understand why you are doing it even if trained and might get the (hopefully) false impression that you dislike him/her.
here's some evidence that they don't work. Lots of good research shows this including this.
So, in conclusion, shock collars don't work, and it'd be better to just discipline the dog yourself.