In the wild, dogs (and their ancestors, the wolves) roam across large stretches of terrain in packs. There is always a pack leader, usually an alpha male, and his partner, the alpha female.
Dogs will test boundaries, just like kids, until you assert yourself as leader in no uncertain terms. Yes, there can be two or more human leaders: your partner, and your dog walker, for example. Your dog needs to understand that people are in charge; they are leaders. Once that is communicated, your dog will become less hyper vigilant and watchful. He or she (not "it") will likely be a little more relaxed about protecting the pack, although depending upon breed, that extinct will not be fully extinguished, and that's probably all for the good.
Leaders go first, and set the pace. The pack follows. If you are walking with your dog, he/she should be in the heel position, on your left, walking right next to you, or slightly behind. You set the pace, making sure to correct if your dog pulls. Stop. Resume your walk, and stop again if the pulling occurs. Repeat as often as necessary. You can also abruptly change direction, which will get your dog's attention. Dogs are intelligent (some more so than others) and capable of learning many human expectations. Do not use an expandable lead, unless you keep the lead short. When you exit your house, go out first, with your dog following. You can train your dog to stay in the sit position at the door until you give a release word, like "okay!" When you return home, enter the house first. Provide food (as a reward) after the walk, not before. If you are not ready to eat but your dog is, try mimicking eating, for about ten seconds before feeding. In the pack, leaders eat first.
It's controversial whether the leadership position is destroyed by inviting your dog to either lounge on your sofa with you, or to sleep in your bed. In your dog's eyes, this is an invitation to equality. But as the saying goes, pick your battles. Decide what's most important to you. Some trainers advocate that the dog follows at all times, including in the home. That is probably a good thing, and will help prevent getting tripped on the stairs.
Leash training is essential for city dogs, as well as keeping identification on your dog at all times. (How many "lost dog" posters have you seen?)
Call in an experienced trainer if it seems that your dog has gained the upper paw in your household. Your life will be a lot saner with a trained dog who is obedient to commands. Consider having your dog trained to respond to both verbal and hand signals. The latter can come in handy should your dog be at a distance, or, if your dog should become hearing impaired late in life.
Don't be afraid to be the Alpha Male or the Alpha Female. If there is more than one leader, make sure the commands are consistent. If your dog forgets, or even does something destructive, punishment is cruel and does not teach anything other than fear. Dogs, like most animals, live in the present moment. In that respect, there is much we can learn from them about living a joyful life in the here and now.