Earpods doesn't work on iPhone7
I suppose you could reach out to Apple support if you can't bring a second pair of EarPods to test that your phone has a working lightning connector. A bit of fuzz or lint could be covering a pin or there could be a rare defect. Rd to know without testing and observing the port.