How do I get my dogs to stop barking?

I live in an apartment and my neighbors across the hall are in and out a lot, and my dogs bark almost every time.

It drives me crazy and I hate to be that neighbor with the loud dogs. Luckily wee live in such a pet friendly apartment complex, so they won't do anything about it, but I still hate making my neighbors listen to it.

How do I get them to stop barking in the moment? And how do I break their habit of barking at the door?