Gather all ingredients and preheat the oven to 375°F (190°C). Grease a 9x13-inch baking dish.
Spread one-third of the potato slices evenly in the dish. Top with one-third of the onion slices.
Sprinkle 3 tablespoons flour over the layer, then dot with 2 tablespoons cubed butter. Season with salt and pepper.
Repeat the layering process two more times.
In a saucepan, warm the milk over medium-low heat until just heated through.
Pour the warm milk over the potatoes until the liquid reaches the top layer.
Bake for 45–60 minutes, until the potatoes are tender and the sauce is bubbling with a golden-brown crust.
Serve hot and enjoy!