Thankfully ants and earwigs aren't usually pests that require a "heavy-duty" approach (like termites or bedbugs, e.g.), and it's true that virtually any home will get an occasional insect inside it. Honestly, those two aren't insects I would worry about much. That said, if they are present at levels that bother you, step one is to see if you can tighten the barrier between the inside and outside of your house, such as by replacing or adding weather stripping at the bottom of your door, and being sure windows are in good repair. Step two is to make the inside of your home less attractive to your pests. Earwigs tend to be attracted to areas that are damp or have water sources, while food residues are generally the biggest draw for ants. So look into reducing those attractants if they may be an issue. For ants specifically, I recommend Terro liquid ant baits. Those are basically the gold standard for homeowner ant treatment. If you've never used them before, be aware that the way baits work isn't an immediate knock-down. What happens is that worker ants gather bits of the liquid bait from the trap thinking it's good food, then take it back to their colony and feed it to their sisters in the nest, hopefully including the queen ant. In a few days, all the ants that ate the bait die. This means, however, that you'll initially get a rush of ants swarming the bait, and may worry that you've made your ant problem worse. Don't freak out while that is happening. You need all of those scout ants to take food back to the colony, or you'll never get to the root of what's causing your ant problem.