You break apart the head of garlic and plant the individual cloves, root side down.
It doesn’t affect the taste or small of anything else. Pests don’t seem to bother the garlic itself but I don’t think it keeps pests away from anything else. Although, if you plant it interspersed with other plants it might confuse some of the bugs.
We do something like that with our eggplant because it always gets infested with flea beatles. It seems to help to plant something with a strong smell, like basil, between the eggplant plants.