If you have a large box, well ventilated and with lots of toys, a new puppy can learn to love it as its own safe place.
Holding the box as a positive place, where the puppy only spends a short time, can be very effective for potty training.
And dogs do not like to go in potty in their own space.
The key to doing boxing work is a good routine and the right schedule.
Especially since it can take months, but often much less than this.
Always go out immediately in the morning and before bed, and 30 minutes after a meal.
Then start by placing your new puppy in his crate for a maximum of 2-3 hours at a time and follow this with an immediate walk outside to do his business.
Choosing a regular place can also help the puppy to associate with going to the toilet there.
You can then keep your puppy out of a box for at least an hour or two to enjoy free time before you sit back.
Soon you will learn your puppy schedule, and some accidents will show you when you have stretched it too far between the box.  So after a week or two, a puppy should need to spend less and less time in the box.
Within a few weeks, a puppy will have learned that the outside is the place for pussies and poops, and the new owner will know the puppy's routine for going out to do business.