15 years ago, I would have sworn I knew everything there was to know about flats and changing a tire. However after a rash of flats, I found out I had developed a bad habit when installing the tire. So while you do need to learn how to do the forensics to determine why a tire flatted. Don't eliminate yourself as being the cause.
In my case, I was just in too big a hurry and the tube was getting caught between the rim and the tire as I rolled the bead of the tire on the rim. Sometimes that resulted in a immediate flat when inflated. And other times I'd get a 1 or 2 rides before it flatted.