In a large skillet over medium-high heat, melt 2 tablespoons of butter.
2 tablespoons butter
Add the onion, garlic, salt, and pepper. Cook for 5–6 minutes, stirring often, until the onions are soft and fragrant. Remove from heat and set aside.
1 large onion, 2 cloves garlic, Salt and freshly ground black pepper
In a medium saucepan, melt 4 tablespoons of butter over medium heat. Whisk in the flour and cook for 1 minute, stirring constantly to form a smooth roux.
4 tablespoons butter, 6 tablespoons all-purpose flour
Gradually whisk in the milk, a little at a time, to prevent lumps. Once smooth, stir in the heavy cream and ¾ of the cheddar cheese. Continue whisking until the cheese is melted and the sauce is thick and creamy. Remove from heat.
2 ⅓ cups whole milk, ¾ cup heavy cream, 1 ½ cups mature cheddar cheese
Layer half of the potato slices in the prepared baking dish that fits in your air fryer. Top with half of the sautéed onions, cheese sauce, and ham. Season lightly with salt and pepper. Repeat the layers with the remaining potatoes, onions, ham, seasoning, and cheese sauce. Sprinkle the top with the remaining cheddar and all of the Gruyère cheese.
1 ½–2 cups leftover cooked ham, 4 medium potatoes, 1 cup Gruyère cheese
Air fry at 320°F (160°C) for 30–35 minutes, or until the potatoes are tender when pierced with a knife. Remove the foil, increase the temperature to 350°F (180°C), and cook for another 5–8 minutes, until the top is golden and bubbly.
Allow to cool slightly before serving. Garnish with chopped parsley.
1 tablespoon fresh parsley