Preheat your oven to 375°F (190°C).
Grease a baking dish with butter.
Layer half of the sliced potatoes in the dish.
Sprinkle half of the minced garlic over the potatoes.
Season with salt and pepper.
Pour half of the heavy cream over the first layer.
Add half of the Gruyère and cheddar cheese.
Repeat the layers with the remaining potatoes, garlic, cream, and cheese.
Cover the dish with aluminum foil and bake for 45 minutes.
Remove the foil and bake for an additional 15 minutes until golden and bubbly.