Without being more specific as to what sort of little fly it is, all I can suggest is a general pesticide. Make a tobacco infusion and spray it heavily on the plants at night (or whenever you have the lights off). Providing it isn't in flowering yet, I'd also be tempted to add soap pods (which contain saponin) into the infusion. If it is in flower, stick to the nicotine poison as it won't effect the taste. Keep it organic and happy growing!