Preheat your oven to 350°F (175°C).
In a large skillet over medium heat, cook the ground beef until browned. Drain excess fat.
Add the chopped onion and minced garlic to the skillet. Sauté until the onion is translucent, about 3-4 minutes.
In a large bowl, combine the cooked beef mixture, frozen hash browns, cream of mushroom soup, milk, salt, black pepper, paprika, garlic powder, and onion powder. Mix well.
Transfer the mixture to a greased 9x13-inch baking dish. Spread evenly.
Sprinkle the shredded cheddar cheese over the top. If using, mix the crushed cornflakes with melted butter and sprinkle over the cheese.
Cover the dish with aluminum foil and bake for 30 minutes.
Remove the foil and bake for an additional 15-20 minutes, or until the cheese is bubbly and golden brown.
Let the casserole cool for 5-10 minutes before serving.