There are two major categories of ways to kill an insect.
1. Attack it with chemicals that interfere with its biologically processes in such a way that it dies.
2. Physically attack its body causing sufficient damage to kill it, such as by crushing it, or shredding it.
(I'll include things like burning it with fire or acid as physical attacks rather than chemical attacks because they kill by destroying the body. I'll count drowning as a physical attack, too).
Within each of these categories there are simple methods that are effective and cheap, but are also not very discriminatory. In the chemical category, that would be pesticides that attack some widespread biological process that is shared by many insects, or in many cases all animals or even all cellular life.
To use this kind of pesticide safely you have to find ways to confine its application to things you are willing to kill, or you have to rely on it taking a lot less of it to kill the "bad" insects than it takes to harm a human and so with some care you can kill the bugs and not make too many people sick.
There are also within each of those categories ways to kill that will only affect one species.
In the chemical category, the key is hormones. An insect is like a little robot that has several built-in behaviors that normally play out in a specific sequence. The timing of when these behaviors happen is controlled by hormones. They are essentially the clock that drives the program.
So let's say you've got some insect that is bothersome. It hatches in the spring, is a pain in the ass all summer, and lays eggs and dies in the fall. If you study it you will find something like the cooling weather in fall triggers a hormone change, and that hormone invokes the "lay eggs and die" behavior.
Congratulations! You now have a way to make a safe pesticide for that insect! You just need to make a pesticide based on that hormone, and apply it sometime between spring and fall before the insect has matured enough to have viable eggs. The hormone will still trigger "lay eggs and die", but the eggs won't be viable. So not only have you killed the insects that summer, you've also decimated the next generation.
The beauty of a hormone approach is that these hormones are already out there in the ecosystem. Every time some predator eats one of the target insects in the fall, that predator is eating the hormone. The hormone is already spread up the food chain, and so things are already adapted to an environment where they are exposed to it. The extra exposure when we start using it in a pesticide will cause little or no harm to other species.
So why don't we do this more? I'll cover that below, after first talking about the physical category of killing insects.
In the physical category, the key is other insects. For a large variety of insects we consider pests, there exists some other insect that either preys upon it or is a fatal parasite to it or that it depends on in some way.
If you know enough about your target insect, you can often bring in one of its predators or parasites, or attack something it depends on, and indirectly control the target that way. This can be especially good when the target is an invasive species.
In many cases insect predators are very specific in their prey, only preying on one specific species. If you pick such a predator to import to attack your target, that is safe because the predator cannot turn to other insects after wiping out the target. Once the target is gone, the predator dies.
So why don't we do this more?
Same reason we don't do the hormone-based pesticides more. Both of these approaches require a much deeper understanding of the insect and its environment than the broad poison approach does.
A lot of this is covered in the excellent book "Life on a Little Known Planet" by Howard Ensign Evans . In the book he mentions an incident where California was suffering large citrus crop losses from some invasive insect. In Florida that insect was kept under control by a particular predator insect. California officials imported that predator--and nothing happened. It turned out that there was another species related to the predator, but it preyed on something other than the species that was invading California. These two predator species were similar enough that no one knew there were two of them. Even though this predator species played a major role in keeping a major agricultural pest at bay, there was only one or two scientists who actually studied them, and they weren't very well funded. There had simply not been enough research put in to notice that they were dealing with two species.