It takes extreme patience, and there will be some "accidents". If this is to be a house dog, and needs to learn to use pee pads, (etc), my best way is to keep the puppy in a small room at first, with his/her water and food and bedding in one corner, and put pee pads (or newspapers, or whatever is the place you want to be the pee spot), covering a big part of the rest of the room. Praise and reward when the puppy uses the part of the floor where the papers/pads are, but don't punish or yell at the puppy at first for mistakes. Only praise for the right place. Then after a week or so, start making the pee area a little smaller, and a little smaller, until it's the size you want it to be permanently. That has worked well for me, but it doesn't work all the time (particularly for cocker spaniels, or small terriers). Plan on the whole process maybe taking a couple of months, and also plan to accept a few accidents now & then, even later.
If there is a part of the room which is already soiled, it's very hard to stop the puppy from repeating in the same place. You need to try to keep the puppy away from those areas, at least until the habits are formed and the puppy is used to going in the right place.
Charles