If using fresh green beans: Blanch in boiling salted water for 3-4 minutes, then drain.
If using frozen green beans: Thaw and drain well.
Make the Sauce: In a large bowl, mix the cream of mushroom soup, milk, garlic powder, black pepper, and salt. Stir until well combined.
Combine Ingredients: Add the green beans, 2/3 cup of the crispy fried onions, and the shredded cheddar cheese (if using) to the bowl. Mix until the green beans are evenly coated.
Assemble: Transfer the mixture to a 9x13-inch baking dish or casserole dish.
Bake: Bake in the preheated oven for 25 minutes.
Add Topping: Remove from the oven and sprinkle the remaining crispy fried onions over the top. Return to the oven and bake for an additional 5 minutes, or until the onions are golden and crispy.
Serve: Remove from the oven and let sit for a few minutes before serving.