I grew up around dogs my whole life. I can't remember a time that we didn't have at least one dog and sometimes had three at once until I went away to college. What my dad and I did to train our dogs was to do what their mothers did when they were puppies. When a dog wants to punish her puppies, she first growls at them to warn them they are getting out of line. If that doesn't get their attention, she bites them gently on the back of the neck or on the muzzle. So what we do is tell our dogs 'no' in a very stern voice first. Sometimes, I even growl at mine and stare them down to emphasize the point. If that doesn't work, I grab them by the back of the neck and force them to the floor. If you do this when they are little puppies, it takes very little force to do so and you can do it without hurting them. The earlier you establish your dominance with a dog the easier it is to get their attention without having to use force. Another thing that works almost as well as grabbing their neck with your hand is putting a choker chain collar on them and jerking on that to emphasize your point. You usually only have to give it one jerk to get their attention and it doesn't have to be done hard enough to hurt them either. We always say 'no' first and give that a chance to work before we do anything physical. That way, the puppy learns that if he doesn't want to experience the physical punishment, he'd better listen to the word or the growl and do as he's told.
Once we establish with the puppy that we are the boss and get him to respond to 'no', we move on to more advanced commands like 'come', 'sit', 'stay', 'heel' etc. Always keep any command to one word and use the same word for that command every time. Dogs don't have a complex vocabulary so you just confuse them by changing the command or talking to them in sentences when you are trying to get them to do something.
More specific to your question, another technique that is helpful in addition to the above when it come to housebreaking is to grab the puppy by the loose skin of the neck and rub the puppy's nose in the mess they made, tell them 'no' in a very stern voice then take them outside. If they pee or poop any outside, even just a little bit, praise them and pet them. Another thing that helps is to lay out wax paper on the floor in a corner of a room, preferably a tile or concrete floor if you have any. Any time the puppy does his business on the paper, praise him and pet him. Any time he does it anywhere else in the home, punish him. If you are consistent and persistent (which is THE key to any dog training)the puppy will figure out that he'd better either do his business outside or at least on the paper.
Barking can be cured by putting a muzzle on the dog every time he barks when you don't want him to. Again, you must be consistent and persistent about this. If you get one that fits right, the muzzle won't hurt him and it's a lot easier than keeping his muzzle pinned to the floor until he stops squirming (especially if he's already bigger than a little puppy). If you do this every time, he'll get the message and stop barking at every little thing. He won't stop barking totally, but you don't want that anyway. Trust me, you want your dog to warn you if someone is breaking in the house or if the dog senses they are going to try to hurt you. Dogs can tell when a person is up to no good and when you are uncomfortable being around a certain person. Praise them when they let you know someone is at the door but punish them if they don't stop barking when you tell them 'hush'.
That's the punishment side. To really be effective we both punish and reward our dogs. Any training program that claims you can train a dog with only rewards and no punishment doesn't work. The best reward is positive attention. Dogs are social animals and love to please their owners. When your dog has done what you want him to do, pet and scratch him and say something like 'good boy' or 'good dog' in cheerful voice. Never pet, scratch or say the word 'good' to a dog when they are doing something you don't want them to do. They need to associate petting and the word 'good' with doing what you want. Treats are okay too, but use them very sparingly. You won't always have a treat handy when your dog is being good so don't rely on them to reward your dog.