I noticed a couple of weeks ago that one of my headlights was out. It took me until a few days ago to change it. When I went to change it the bulb was broken. I made sure not to hurt myself, changed the bulb, and went about my business. Less than 24 hours later I noticed the exact same headlight I had changed was again out. I cracked the hood to check it out and the bulb was broken. Is this a coincidence?
Nope. With modern halogen bulbs you have to be careful not to touch the glass when installing them. The oils on your fingers carbonize from the heat and create a hot-spot on the bulb. That is why your new bulb burst.
This time be careful to only handle the bulb by its base, if thats not possible consider a clean rag or gloves for the install. If you accidentally touch the glass you can clean in with a rag and a little alcohol.
Since the original that you didn’t touch was burst as well, it’s possible that water is getting in there. Did you have some rain before the new bulb went out?
Have seen this often with composite headlights. You have water intrusion popping the glass when the bulb gets hot. You can remove headlight assembly and drill a small hole at the lowest spot in the assembly so water will drain.
You already have the two most common causes of this condition listed here by others: fingerprints on the capsule or water in the headlight assembly. Either can cause the capsule to burst. If it’s water intrusion, drilling a hole as Pete suggested may solve the problem. If it does not, you will have to replace the headlight assembly, which will be financially painful, though less painful than constantly having to replace capsules and pay fines for lighting violations.