No need to do anything to the substrate if you have fruit flies, the larval fruit flies develop in the fruit you are giving the adult beetles and do not do anything to the substrate.
Best way of dealing with fruit flies is to catch at adults with a vinegar trap. Take a small pot or container and put in some fruit or about an inch of vinegar. Cover this with cling-film / food wrap and make a couple of small holes in the film just big enough for the flies to get in. The adult flies will be attracted to the scent of the fruit / vinegar, find their way inside and will be trapped, they usually drown if you have used vinegar. Works a treat and catches a LOT of flies.