I handle it differently from other people. It kicks the problem down the road a bit and horrified trainers, but it works for me.
I'm a softy and don't like listening to the I'm-alone-in-a-strange-place-for-the-first-time-ever existential puppy wailing. We also have a second floor bedroom, so we cant easily get a leaky puppy aout into the yard from the bedroom. We start out with a day crate in our sunroom and a night crate in the bedroom.
When the puppy is brand new I sleep on the couch in the sunroom with the puppy sandwiched between me and the back of the couch. If puppy won't settle he goes into the day crate for a few minutes. Since he doesn't want to be alone, he soon realizes that settling is the way to keep couch privileges and a sleeping companion.
At some point in the middle of the night he will start wiggling because he needs to pee. We make a beeline to the yard and then return to the couch as soon as essential business is done. Again, couch privileges are revoked if puppy won't settle.
During the day for these first couple weeks we try to make the day crate a place where good things happen. We feed in the crate. We put new toys in the crate. We toss smelly old T-shirts in the crate. We put chews in the crate. We toss treats in the crate. Any time puppy goes in the crate something he will enjoy is there. Puppy goes in the crate or the attached x-pen any time we can't keep a gimlet eye on him. However, we stay nearby, so he gets used to the idea that we come right back when we disappear from view.
After the first couple weeks the puppy Is more confident about the way the household works. Leaving him alone in the crate produces a wail of outrage rather than a wail of fear and loneliness. At this point we start leaving him in the day crate for longer periods. If he yells we exit the sun room and shut the door. (I'm a lot harder hearted about puppies throwing tantrums than I am about lonely grieving puppies.) If he's quiet we stay nearby reading. His reward for being quiet is to keep us near.
We make the transition off the couch to the night crate in the bedroom around this time. ( I'm more confident about his bladder capacity.) On a Friday night we play hard and get him really tired. Then we plop him in the night crate with the cushion, toys, and smelly T-shirt from his day crate. With luck he will flop down and go to sleep with minimal fuss.
If he seems distressed, we talk to him a bit to reassure him we're nearby. A prolonged tantrum earns him a trip back down to the day crate, where he stays alone until he's quiet. Then we try again in the night crate. Settling can take a while, which is why we do ithe transition on the weekend, when we can sleep in or nap the next day.