Heat oven to 350°F.
In a large pan over medium heat, add butter. Once the butter has melted, add the chopped onion and saute 3 to 5 minutes, until the onion is soft and translucent. Add the minced garlic and cook another 30 seconds.
Sprinkle flour over the softened onions, then whisk for about 1 minute to remove the raw flour taste. Whisk in the chicken broth and milk. Add salt and pepper, then continue to cook, whisking frequently, until thickened, about 2-3 minutes.
Remove the sauce from the heat and whisk in sour cream.
In a large bowl, combine the thawed and drained shredded potatoes, sauce, and cheese. Stir until everything is evenly combined.
Spread the cheesy potato mixture into a large 9x13" baking dish and press into an even layer.
Cover with foil and bake for 45 minutes, until heated through and bubbly.
In a separate bowl, combine the crushed cornflakes with ¼ cup melted butter. Toss together with a fork to coat the cornflakes with butter, then sprinkle over the top of the cheesy potatoes.
Bake, uncovered, for another 15 minutes until hot, toasted, and bubbling.