Spinosad spray kills earwigs but I didn't find it very lasting. They are mobile ... like to move around at night. So, they may be nearby but the spray is ineffective in a day or two.
Sluggo makes a bait for slugs, snails AND earwigs. It uses spinosad.
Since they eat most anything, I bet the bait works well.
Earwigs are related to cockroaches, and are just about as difficult to get rid of. They like to hide under moist cover, so it helps to remove any debris, stone, or wood in or near the garden. Bad news if the garden is heavily mulched.
Had a bad earwig problem one year; they turned out to be nesting in the crack of a tree which had been split by lightning. Cut that tree off just below the split, then sprayed them as they came pouring out. They have been only an occasional nuisance since; but I am expecting to see more than usual this summer, since this has been a wet year. Had a few find their way into the house, which is not a good sign.