Some insects use weapons. Others rely on flight, concealment, motion, armor, and even grotesqueness. Some really interesting insects use powerful chemical warfare. Bees, wasps and many ants have powerful stings. Some of the poisonous chemicals they inject into attackers can be very painful.
Some ants can fire an acid fluid from their rear ends.
If you disturb a nest of wood ants, you'll be able to smell the acid as the ants rush out and spray it in all directions. Many insects can put off would-be attackers by producing chemicals that taste horrible. Ladybirds, for example, give out a foul-tasting yellow fluid if they are attacked. Some of the fluids given off by insects are quite poisonous. Many caterpillars are covered with irritating hairs which make attackers let go of them.