As with most pest control, prevention is certainly better than cure for fruit flies, so a high standard of sanitation is of paramount importance. If, however, pest problems are detected the site should be inspected thoroughly as they may have several breeding places, wherever fermenting, moist and decaying organic materials are available.
There are fruit fly pest control traps available that use vinegar or other fermenting foods to lure and capture fruit flies, such as jar traps. Pesticides are also an option, but may only provide temporary relief, so be sure to contact a pest control professional to discuss the best long-term options.