The main ingredient of garlic which fights the germs is Allicin.
The best way to use garlic as immune booster is eating it raw. Chewing releases the allicin in the mouth which is absorbed by the body.
When it’s taken in foods or in the form of pills, the effectiveness is not the same, as it goes directly to the stomach and the active compound, allicin is inactivated by the acidic nature of the enzymes in the stomach.
So, you either take 2-3 garlic cloves raw in a day or you chop it very less and use it in soups, salads, etc, wherein it can be chewed, for reaping its benefits.