ich is a parasite, so it can be impacted by medicine given to your fish. Garlic is a natural medicine that does help deter ich and can help in treatment once a fish is infected, however, I would not count on it curing the problem if your fish is severely infected or if you have an outbreak in your tank. NOrmally fish only succumb to ich if they are stressed, so you need to check all water parameters and tank conditions-water temp consistant, salinity where it should be, no aggressive fish picking on more peaceful specimins, no ammo, nitrites, and nitrates low. Do you do frequent water changes?
When ich shows up, it means there is a problem that needs fixing. Healthy fish can shrug off this parasite easily. If you have one fish with only one or two white spots, I would feed garlic in your food, also an rx food, do a larger than normal water change and make sure everything in your tank is a-ok