I have done it two ways. First, to get my goldies to even touch the peas after I got them, I shelled and mushed the peas, then mixed them with a finely chopped clove and a bit of tank water and zapped it in the microwave for a few seconds. Once it was cool, I fed just the peas and they went nuts over them. I have done this every time so far, and probably will until the ich is cleared up. Second, I rough chop one to three cloves of garlic and put it in about 1/4 cup or so of tank water and boil it in the microwave and then put it in the fridge over night. This creates a garlic infusion which I then pour, just the water, into the tank. The infusion makes the entire room smell of garlic for a day or two, but I can live with that.
It's both an immune booster and an antibacterial.
EDIT: I've also read that some people put a little bit if garlic powder (not salt) on the water when they drop their flakes in. I'm not sure how that could work for goldies unless you make your own food and add garlic to the recipe. Or soak their pellets in some garlic juice before giving it to them, that might work
Also, for the infusion, I can't remember if it was 1 teaspoon or 1 tablespoon per 5 or 10 gallons of tank water. I'm trying to find the post I found it on.