Suppose you consistently praise your puppy for their actions, while potty training. Then say your dog has an accident. Do not praise you dog immediately. Instead, take your dog outside and wait for it to go to the bathroom. When it finishes doing its business, take it inside, and keep it in a separate room while you clean up the mess. After this you should act disappointed in your dog, but only for a few minutes. Keep you and your dog motivated to potty train.
It also helps to teach your puppy a “potty phrase” when you take him outside for a bathroom break. A potty phrase is a way to gently remind your puppy what he needs to do when he’s outside. It’s a big help during the potty training phase of puppyhood and you can continue to use for the rest of his life. Pick a phrase like “hurry up” or “go ahead” and say it softly right as your puppy eliminates. In time your dog will associate the phrase with the act of elimination, so you can say it when your puppy gets distracted and forgets what he needs to do outside.
While indoor elimination solutions like potty pads and litter boxes have their place, using them can actually slow the process down if you plan to eventually have your dog eliminate exclusively outside. Teaching your puppy to potty inside sometimes and outside others can be confusing because you will eventually have to teach your dog that at some point the indoor option is no longer allowed. Potty pads work best for people who can’t get their puppy outside quickly, like those who live in high-rise apartments or have limited mobility.
I don't teach or recommend so-called "purely positive" methods that allow misbehaving pups to continue misbehaving, instead of teaching them which behaviors are and are not allowed. "Purely positive" is fine for teaching tricks and high-level competition exercises, but NOT for teaching the solid good behaviors that all family dogs need to know, and NOT for stopping behavior problems such as barking, jumping, chewing, nipping, chasing, etc.
Crate training is a vital part of potty training success. As den animals, dogs can appreciate crates as a safe space, and as clean creatures, they’ll often want to keep that sleep space clean. A crate of the proper size is important, as one that is too large may convince the pup they have space to both sleep and eliminate. Puppy pads give dogs the option of relieving themselves in an approved spot indoors. However, these can be tricky to train with if you’re ultimate goal is to get the pup to only potty outside eventually.
The process is the exactly same for older dogs as it is for puppies; prevent accidents from happening by using baby gates and a crate if possible, create a predictable schedule, learn to recognize your dog’s potty signals, accompany your dog outside and immediately reward for all outdoor elimination, properly clean any accidents and supervise your dog until you’re sure that he understands the rules.