The best thing you can do is move on from it! Chances are it could have either been prevented (by us) in some way and/or your puppy just couldn't hold it in anymore.
Whether it was because they were waiting too long, or we forgot to take them out, or they've been drinking too much water, or even purely out of excitement.
Much like with a baby, toddler or child who has an accident, the best thing you can do is not get frustrated, accept that it happens and move on from it. Don't let that be something that gets in the way of your relationship with your pup! Plus, chances are that your pup won't understand why you're not happy with them to begin with.
So instead focus all your attention on when your pup DOES pee outside or on their designated pee pad. If you're finding there's an abnormal amount of accidents, begin by better monitoring your pup's water intake and reaching out to your vet to rule out a UTI.