An exterminator was someone who eradicated non-sentient lifeforms, generally insects, from areas where they were unwanted.
Upon encountering Species GS54, the pilot of SPT 21 was instructed to put on an EV Suit and play exterminator. This did not go well. (DIS: "Context Is for Kings")
Doctor Paul Stubbs likened the nanites which had taken control of the USS Enterprise-D in 2366 to mosquitoes. Not believing that they were sentient, he suggested that the devices be dealt with in the same manner as a "mosquito that bites your ear", with an exterminator. The eventual discovery of the nanites' sentience, however, precluded that possibility. (TNG: "Evolution")