Step 1: Preheat your oven to 375°F (190°C). Grease a medium-sized baking dish with butter or cooking spray to prevent the potatoes from sticking.
Step 2: In a medium saucepan, melt the butter over medium heat. Once melted, add the minced garlic and sauté for about 1-2 minutes, or until the garlic becomes fragrant and slightly golden. Be careful not to burn it, as burnt garlic can impart a bitter taste to your dish.
Step 3: Pour in the milk and heavy cream, stirring continuously to combine. Heat the mixture gently until it's warmed through but not boiling. This will ensure that the cream sauce melds beautifully with the potatoes during baking.
Step 4: In the prepared baking dish, layer half of the thinly sliced potatoes, ensuring they are evenly distributed. Pour half of the creamy garlic mixture over the potatoes, spreading it out gently. Repeat this process with the remaining potatoes and the rest of the cream mixture.
Step 5: Top the final layer of potatoes with the shredded cheddar cheese. Season with salt and pepper to taste. Cover the baking dish with aluminum foil and bake in the preheated oven for 30 minutes. After 30 minutes, remove the foil and continue baking for an additional 15-20 minutes, or until the potatoes are tender and the cheese is golden brown and bubbly.