Preheat your oven to 350°F (175°C) and lightly grease a 9x13-inch baking dish.
In a large bowl, mix the potatoes, ham, cream of chicken soup, cheddar, sour cream, milk, green onions, garlic powder, and black pepper until fully combined.
Spread the mixture evenly in the greased dish and smooth the top with a spatula.
Stir crushed cornflakes or breadcrumbs with melted butter, then sprinkle evenly over the casserole.
Bake uncovered for 45–50 minutes until bubbly, with tender potatoes and a golden, crisp topping if used.
Let it rest for 5–10 minutes to set before slicing and serving.