Preheat the oven at 400 degrees F (204 degrees C) .
Peel and discard the outer layers of the whole garlic bulbs. Cut about ¼ to ½ inch (0.6 to 1.3 cm) off the top of each head of garlic, exposing the cloves inside.
Line a baking dish with a large piece of foil. Place the garlic heads onto the foil, cut side up.
Sprinkle each head of garlic with salt and pepper. Drizzle 1-2 teaspoons of oil over each, making sure it runs between the cloves.
Close the foil around the garlic and seal. Roast garlic in the oven for 30-40 minutes.
Let the garlic cool from hot to warm. To remove the roasted garlic from the heads, squeeze from the root end into a bowl.