Preheat your oven to 350°F (175°C). Grease a baking dish.
In a saucepan, melt the butter over medium heat. Stir in the flour, salt, and pepper until smooth.
Gradually add the milk, stirring constantly, until the mixture thickens and bubbles.
Remove the saucepan from heat and stir in the shredded cheddar cheese until melted.
Layer half of the sliced potatoes in the prepared baking dish. Pour half of the cheese sauce over the potatoes.
Layer the remaining potatoes on top, and then pour the rest of the cheese sauce evenly over the top.
Cover the dish with foil and bake for 45 minutes.
Remove the foil and bake for an additional 15-20 minutes, or until the potatoes are tender and the top is golden brown.
Let it cool for a few minutes before serving.