First remove and dispose of any fruit or other material in which the flies are breeding. Fruit flies tend to swarm around and crawl on the things they are breeding in. You must find and remove the breeding source or the fruit flies will persist indefinitely. Then clean the areas where fruit flies are breeding. Common areas include the kitchen, places where trash is kept and the pantry. It is recommended that the area be cleaned with products containing bleach. Be sure to ventilate the area. Also empty and wash out all trash cans.
Next pour bleach down all drains bleach will help get rid of the clogged decaying organic material that is attracting the fruit flies. Be sure to flush the drain with fresh water.