Heat the oven and prep the dish. Preheat to 350°F (175°C). Lightly grease a 9x13-inch baking dish with nonstick spray.
Thaw the hash browns. If they’re still icy, spread them on a sheet pan for 10–15 minutes at room temp. Excess ice creates watery casserole, so aim for thawed and dry.
Sweat the onion (optional but worth it). In a small skillet, cook the minced onion in 1 tablespoon of the melted butter over medium heat until soft and translucent, 3–5 minutes. Cool slightly.
Mix the creamy base. In a large bowl, stir together the cream of soup, sour cream, remaining melted butter (about 5 tablespoons), salt, pepper, and garlic powder until smooth.
Add potatoes and cheese. Fold in the thawed hash browns, sautéed onion, and 1 1/2 cups of the cheddar. Don’t overmix—you want shreds to stay intact.
Fill the pan. Spread the mixture evenly in the prepared dish.
Sprinkle the remaining 1/2 cup cheddar over the top.
Make the topping. In a medium bowl, combine crushed corn flakes with 2 tablespoons melted butter until evenly coated. Scatter over the casserole in an even layer.
Bake. Place on the center rack and bake for 45–55 minutes, until the edges are bubbling and the topping is golden brown. If browning too fast, tent loosely with foil for the last 10 minutes.
Rest and serve. Let the casserole stand 10 minutes before serving. This helps it set and makes cleaner scoops.