You can either get a bark collar (there are ones that vibrate rather than shock, all you need is for it to surprise them) or every time it starts barking, put it into another room until it stops, let it out, if it starts again, put it back in, let it, etc... until it stops because they don't want to be in another room...
All of these are good suggestions but I know I had a Beagle, & God knows I loved my little Dixie, she was a beagle, but she was so stubborn, she would whine more than bark but she would bark but I bought a collar & everything & I couldn't get her to stop, nothing worked, not putting her in another room, putting her outside didn't work either cause I could still hear her, I'm a very light sleeper. I even tried to house train her for the potty but she would still just go & pee & poop wherever she wanted, we finally came up with a solution but by then it was too late cause she got loose & was hit by a car. But I've heard that some dogs are better with training than others. I've also heard that getting them a few weeks old where no one else has gotten them use to anything helps you train her the way you want her to be too. Here she is though, she was so cute!
If my dog does that he's tied up outide for a few munites as punishment (like time out) i find it very effective. Alternatively there are bark collers, but I can't recomned one cause I would never use it on my dog.....EVER!
use a squirt bottle or rolled up newspaper, just don't over do it, also give them treats when they do good.We rescued a malamute husky ,about two years ago,he was chewing up everything.We punished him for a little while, but now he gets more treats, than in trouble.
U can train with preshurized air or water, take the dog out for more walks or buy one of those bark collors that vibrate.(my friend lives in an apartment and has a noisy dog so she uses one of those. they cause no harm to the dog and keeps him quiet. its almost like the dogs being tickled)