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.
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.