Your puppy doesn’t enjoy getting scolded, as was already stated. On the other hand, your puppy loves praise or positive reinforcement. When your puppy is doing something right, you should reward him. Scolding a puppy for soiling your rug, especially after the fact, isn’t going to do anything except make her think you’re a nut. Likewise, some old methods of punishment, like rubbing a dog’s nose in her poop, are so bizarre that it’s hard to imagine how they came to be and if they ever worked for anyone.
Prior to the 1980s, Karen Pryor was a marine-mammal trainer who used Skinner's operant principles to teach dolphins and develop marine-mammal shows. In 1984, she published her book, Don't Shoot the Dog: The New Art of Teaching and Training, an explanation of operant-conditioning procedures written for the general public. In the book Pryor explains why punishment as a way to get people to change often fails, and describes specific positive methods for changing the behaviour of husbands, children and pets. Pryor's dog training materials and seminars showed how operant procedures can be used to provide training based on positive reinforcement of good behavior. Pryor and Gary Wilkes introduced clicker training to dog trainers with a series of seminars in 1992 and 1993. Wilkes used aversives as well as rewards, and the philosophical differences soon ended the partnership.
Consistency is crucial. This may mean taking time off work to be there to take the pup outside every 20-30 minutes when they are awake. Crate training will also help the 'penny drop' as it teaches the pup to hold on until taken outside. Then, be sure to stay with the pup in the yard so you are there to reinforce how clever they are when they do go in the right place.
A training class is not there to train your dog. Its purpose is to teach you to train your dog so you will need to be committed to train your dog for short sessions (5 minutes) several times a day rather than just simply turn up for classes! This little bit of training everyday will be repaid with a lifetime of living with a well behaved dog. You will also learn to avoid problems before they begin as well as receive help to overcome any that you already have with your dog.