Take your puppy out regularly
Puppies don't know to ask to go to the toilet so your best chance at avoiding accidents is by taking them out every 1-2 hours.
Wait with your puppy
Take your puppy to the spot you want them to go and then stay with them. This is important so that you know that they have actually gone and for the next step.
Praise your puppy
Once your puppy has gone to the toilet, reward them with a treat and your cue word (not good boy/girl as this can lead to them associating praise with going to the toilet!). If you are clicker training then remember to use their clicker too.
Even with a solid routine, a puppy is going to have accidents. As annoying as this is, try not to scold or punish them.
Dogs don't respond well to negative reinforcement and a puppy is unlikely to realise what they have done wrong, leading to confusion and possible apprehension about going to the toilet in front of you.
Try not to let your puppy out of your sight whilst they are toilet training as this could lead to hidden accidents!
Some breeds are much slower at toilet training than others and it can sometimes seem like a never ending struggle but all dogs will get the hang of it eventually with the right training.
The worst thing you can do for you and your dog is to lapse on your routine, this will only confuse your puppy and undo your hard work.
If your puppy goes in the house
Take them to the spot they are supposed to go straight away so they remember to associate that area with the toilet.
Clean up the mess calmly and with an ammonia free product (ammonia smells similar to urine for puppies so could be confusing)