Generally the best time of year to plant garlic is in fall (late September to mid October) because the plants need a natural dormant period that includes exposure to cold temperatures (a process called vernalization).
Hardneck garlic, in particular, will only form bulbs and scapes if it’s had proper cold exposure. Without vernalization, some garlic plants will not divide, leaving you with rounds (single-clove bulbs). While the rounds are still edible, you’ll get more out of your crop with a fall planting.
Garlic likes full sun and rich, well-draining soil (though it can tolerate many soil types). If yours is on the clayey side, add 2 to 3 inches of aged compost on top of the soil to help loosen it and improve soil structure.
Break your bulbs apart and pick out all the cloves that are firm and plump, leaving the papery wrapping on each clove as intact as possible.
Dig a trench about 2 to 4 inches deep. (Warm climates can go as shallow as 2 inches, and cold climates should go up to 4 inches deep the farther north you are.) Plant each clove, root end down (and pointy end up), 4 to 6 inches apart with 6 to 9 inches between rows.