Grease a 9 by 13-inch casserole dish, and preheat the oven to 350°F. Thinly slice the potatoes and optional onion, and cube or dice the ham.
6 Yukon Gold potatoes, 1 small Onion, 2 cups Ham
Melt the butter in a large saucepan over medium heat. Once fully melted, add the flour and whisk together until a thick paste forms, letting it bubble for 3-4 minutes.
3 Tablespoons Butter, 3 Tablespoons Flour
Very slowly pour in the milk, then the heavy cream, whisking continuously until thick and creamy.
2 cups Whole milk, 1 cup Heavy cream
Add in the shredded cheese, salt, and pepper, then mix until melted and combined. Add paprika, if using.
2 cups Sharp cheddar cheese, 1 teaspoon Salt, 1 teaspoon Pepper, ½ teaspoon Paprika
Place half of the sliced potatoes, onions, and half of the ham into the baking dish. Sprinkle with salt and pepper.
Pour half of the cheese sauce mixture over the potatoes.
Add the remaining potatoes, ham, and onions, then sprinkle again with salt and pepper. Then top with the remaining cheese sauce. Top with herbs, if using.
Fresh herbs
Cover with tin foil, then bake for 1 hour.
Remove the foil. Cover with one last layer of cheese, then bake for 20 more minutes, until the cheese is browned and the potatoes are tender.
Remove from the oven, let cool slightly, and enjoy!