Enroll your dog in basic obedience training classes. Most humane societies offer these classes at reduced rates or for free as part of their organization's mission. Your dog will be much happier when she knows what you expect of her. Practice commands daily until she obeys joyfully and without hesitation. Be consistent and praise your pet lavishly when she does the right thing. If you show pleasure at her behavior, she will do it again.
Step 2:
Remember that most cats are probably not trainable. You may see cats that are expert con artists and cats as dumb as a box of hammers. Consistency is the best policy with both. You'll either have a hunter or a homebody. All you can do with the hunter is to limit access to the outdoors and put a good, noisy bell on his collar along with his rabies tag. Most cats will respond to a sharp "no" if you do it often enough, but you have to be absolutely consistent about any training strategy. Limit your physical discipline to a tap on the nose along with "no". Short shots from a squirt bottle filled with water can work, too. However, they must be reserved for really bad mistakes, such as shredding Gram's antique settee.
Step 3:
Play with your pet in your yard and introduce her to all the neighbors as they walk by. A social pet is generally well-accepted. If you own a special breed, you'll easily draw a crowd anywhere you walk. Your yard should be safe place for your pet. It gives you a place to practice together and hold court. If your pet is protective, she needs to learn to respond to your "this is a friend" signal and to meet new people.
Step 4:
Institute a mealtime code of behavior for all meals, not just the ones with guests. Feed your pet before you feed your guests. Expect your dog or cat to go lie down while people are at table. Have a special command like "Time Out" or "Go Lie Down" to signal that it's time to leave the folks alone with each other. If your dog is crate-trained, use that for a nap. Your dog should know that table time is your time, and that you'll play with him after your meal is finished. Praise him when he shows he understands good table manners.
Step 5:
Make regular trips to your local dog park where your dog can socialize off-leash. While she runs off that extra energy, you get to interact with the other owners. If your dog park has a volunteer group, join it and teach your four-legged citizen about community service.
Step 6:
Your pet will inevitably commit sins against your crabbiest neighbor's sensibilities, invariably as she's looking out the front window. A little piddler or a rabbit-stalker can be more easily forgiven if you've made a point of introducing yourself to your neighbor and immediately apologize for the offense.
Tips & Warnings
Talk to your dog as you would a teenager, not an infant. If you are patient, consistent and praise good behavior lavishly, you'll have a well-behaved companion. If you change the rules depending on the situation and scream at mistakes, you'll end up with a surly, defensive pet.
If you walk your dog on the sidewalk, don't let her stray into yards. Try to encourage her to wait until you get to the vacant lot or city easement at the end of the block to do "her business." Always carry a (prominently displayed) bag to pick up leavings.
Treat training has fallen out of favor. Your dog's obedience should not be dependent on goodies or fear of punishment.
Dogs and cats are social animals who become depressed and aggressive when isolated. If you don't want to spend time with your pet or if you consider a companion animal as property or a status symbol rather than a member of your family, don't expect your dog or cat to be well-mannered.