Peel away any loose outer papery layers from the garlic bulbs, but keep the heads intact. Slice about 1/4 inch off the top of each bulb to expose the cloves.
Place each garlic head cut-side up on a piece of foil. Drizzle the exposed cloves with olive oil and lightly season with salt and black pepper, if using.
Wrap the garlic loosely in the foil to make packets. Roast for 40 to 50 minutes, or until the cloves are soft, golden, and spreadable. Start checking around the 35-minute mark.
For deeper color, carefully open the foil for the last 5 to 10 minutes, if desired.
Let the garlic cool just enough to handle, then squeeze the roasted cloves out of their skins and use as desired.
Video
Notes
Air fryer variation: Prep the garlic the same way, then air fry at 370°F/190°C for 25 to 30 minutes. If you want deeper color, open the foil for the last 3 to 5 minutes.
Peeled-clove variation: For a faster option, roast peeled garlic cloves with a little olive oil at 400°F/200°C for 20 to 25 minutes, until soft and lightly golden.
Storage: Refrigerate roasted garlic for up to 4 days or freeze in small portions for up to 3 months.