Preheat the oven to 375°F (190°C)
Butter a 2-quart casserole dish.
Arrange half of the sliced potatoes in the dish, season with salt and pepper.
Add the remaining potatoes and season again.
In a saucepan over medium heat, melt the butter, whisk in flour and salt, and cook for about a minute until the raw flour taste is gone.
Slowly add milk, about ¼ cup at a time, whisking constantly to prevent lumps.
Cook until thickened, 3 to 5 minutes, then stir in the cheese until fully melted.
Pour the shredded cheese over the layered potatoes, ensuring even coverage.
Bake for about 1 ½ hours, until the potatoes are tender and the sauce is bubbling.
Serve hot and enjoy.