Someone else's earwax on brand new Apple earbuds?

I was just wondering how often the manufacturers that produce the Apple earbuds test them? Do you think they have to test out every pair that's produced or just some of them? Because I bought an iPhone 6S Plus from Walmart. And earlier when I took the earbuds out of the (sealed) package, I noticed that there was a tiny amount of earwax on the inside of both buds.

How do you fix an iPhone 7 that keeps freezing?

Since a few days ago, my iPhone has been freezing randomly and shutting down, and then restarting on its own. As soon as it restarts, the phone freezes (before I can put in the password). I can't reboot the phone because it freezes before I can hold the home and power button long enough to do so. My iPhone will keep on freezing and restarting on its own until it runs out of battery. After I recharge it, the phone will function a few hours normally, until it starts freezing again. The process then repeats. How do I stop this?