1. **Preheat oven to 375°F (190°C).**
Grease a 9×13-inch baking dish.
2. **Prepare the sauce:**
In a saucepan over medium heat, melt the butter. Add the minced garlic and cook for 1 minute. Stir in the heavy cream or milk and bring to a gentle simmer. Season with salt, pepper, and thyme (if using). Remove from heat and set aside.
3. **Assemble the dish:**
Layer half of the sliced potatoes in the greased baking dish. Pour half of the cream mixture over the potatoes. Sprinkle half of the cheddar and Parmesan cheese over the layer. Repeat with the remaining potatoes, cream mixture, and cheese.
4. **Bake:**
Cover the dish with foil and bake for 45 minutes. Remove the foil and continue baking for an additional 20-25 minutes, or until the potatoes are tender and the top is golden and bubbly.
5. **Serve:**
Let the scalloped potatoes cool for a few minutes before serving.
Enjoy your creamy, cheesy scalloped potatoes!