Preheat & Prep: Preheat oven to 375°F (190°C). Grease a 9x13-inch baking dish.
Cook the Beef: In a large skillet over medium heat, cook ground beef until browned. Drain excess grease and season with garlic powder, onion powder, salt, and pepper. Set aside.
Make the Sauce: In the same skillet, whisk together flour and 1/2 cup of milk over low heat until smooth. Slowly add the remaining milk, stirring continuously until thickened.
Layer the Ingredients: Place half of the sliced potatoes in the prepared baking dish, followed by half of the onions, beef, and creamy sauce. Repeat layers.
Bake Covered: Cover the dish with foil and bake for 45 minutes.
Add Cheese & Finish Baking: Remove foil, sprinkle shredded cheddar cheese on top, and bake for another 15-20 minutes until bubbly and golden brown.
Rest & Serve: Let the dish sit for 5-10 minutes before serving. Enjoy warm!