Potty training a puppy is a matter of attention and attitude. The "attention" part should be obvious by now; you need to always have an eye on your puppy unless they're crated or outside, and you need to be aware of when they've had their food and water so you can make reasonable prediction about when they need to go.
The "attitude" part can be a little trickier for some owners. Your puppy will make mistakes. You will make mistakes. Housetraining does not happen instantly, or even in the course of a few days. It takes anywhere from a couple of weeks to a month even if everything goes just right. So you have to let go of expecting things to be perfect, but you also need to be working on making them as good as possible, all the while not stressing about it. I imagine Zen masters are good at potty training puppies.
One thing to remind yourself as you through the process is that any time you catch your dog starting to "go" in the house - that's a success. Assuming you instantly startled/interrupted you puppy and ran/carried them outside to (hopefully) finish, that was a learning experience for them. The only failures are those times you just totally took your eyes off your dog and they pottied in the house and no one caught them. Smack yourself in the back of the head and promise to do better.
I've had a lot of "learning experieces" with Krypto. Fewer each day, but I'm still catching him once or twice a day thinking about going in the house. I don't mind those times - they're just the necessary steps on the way to being fully housetrained. Because now I'm also sometimes seeing him walk himself to the back door on his own! Or at the very least, letting me know that he needs to go outside by acting fussy and a little whiny on leash. Good boy!
I've also had a small handful of actual mistakes - four that I can remember, maybe a couple more that have slipped my memory. Most were just foolishness on my part - I left him alone in the living room to go get some treats from the kitchen and came back about 15 seconds later to find a puddle on the floor. Once was more understandable - there was a commotion outside the house that I went to check on. Molly had Krypto, but she followed me outside to see what was going on, and when we came back in, he'd peed by the front door. Eh, whatchya gonna do?
(I really should have some pictures of those "mistakes," but somehow it keeps slipping my mind to take a picture of a puddle of pee.)
It's vitally important to maintain your sanity by making liberal use of crating and confining your dog during this period. If you have your puppy out all the time, you'll go mad with the strain of keeping an eye on him all the time. Krypto spends a lot of time in his pen and his crate, which has the added benefit of helping him avoid separation anxiety later on.