Preheat your oven to 350°F (175°C).
In a large mixing bowl, combine the frozen hash browns, sour cream, cream of chicken soup, 1 ½ cups of the shredded cheddar cheese, onion (if using), garlic powder, salt, pepper, and melted butter. Mix well until everything is evenly distributed.
Pour the mixture into a greased 9x13 inch baking dish, spreading it evenly.
Sprinkle the remaining ½ cup of shredded cheddar cheese on top of the hash brown mixture.
In a small bowl, mix the cornflakes or crushed potato chips with a little melted butter. Sprinkle the mixture over the cheese layer for added crunch.
Bake in the preheated oven for 45 minutes, or until the top is golden brown and bubbly.
Let the casserole cool for a few minutes before serving.