Instructions:
1. Preheat your oven to 375°F (190°C). Grease a baking dish with butter or cooking spray.
2. Peel the potatoes and slice them into thin rounds, about 1/8 inch thick. You can use a mandoline slicer or a sharp knife to achieve even slices.
3. In a saucepan, melt the butter over medium heat. Add the minced garlic and sauté for about 1 minute until fragrant.
4. Stir in the flour and cook for another minute, stirring constantly. This will create a roux, which will thicken the sauce.
5. Gradually pour in the milk while whisking continuously to avoid any lumps. Continue cooking and whisking until the sauce thickens, about 3-4 minutes.
6. Remove the saucepan from heat and stir in the shredded cheddar cheese until it melts and the sauce becomes smooth. Season with salt and pepper to taste.
7. Arrange a layer of sliced potatoes in the greased baking dish, slightly overlapping them. Pour a portion of the cheese sauce over the potatoes, spreading it evenly to cover them. Repeat the process, creating multiple layers of potatoes and cheese sauce until all the ingredients are used.