An ultrasonic bark deterrent makes a high sound that most people cannot hear but dogs can. When the dog barks, the sound gives a quick "stop" signal. It does not touch the dog. The goal is to break the barking loop for a second so you can reward the quiet.
These tools work best as part of training, not in place of it. Pair the sound with praise or a treat the moment your dog goes quiet. Use it for a short time and watch how your dog reacts. If your dog seems scared, stop and try a different approach.
For a clear breakdown of how these devices work and who they fit, read this guide on the ultrasonic dog bark deterrent.