01 - Preheat the oven to 350°F. Grease a 9x13-inch baking dish with butter or cooking spray.
02 - Bring a large pot of salted water to a boil. Add fresh green beans and cook for 4-5 minutes until just tender. Drain immediately and rinse under cold water to stop the cooking process. Skip this step if using canned beans.
03 - In a large mixing bowl, whisk together the condensed cream of mushroom soup, whole milk, sour cream, garlic powder, onion powder, black pepper, and salt until completely smooth and well combined.
04 - Add the prepared green beans, shredded cheddar cheese if using, and French fried onions to the sauce mixture. Stir gently until all ingredients are evenly coated and distributed throughout the creamy sauce.
05 - Pour the green bean mixture into the prepared baking dish. Use a spoon or spatula to spread the mixture evenly, ensuring a uniform layer across the bottom of the dish.
06 - In a small bowl, combine the crushed Ritz crackers with melted butter. Mix thoroughly until all cracker crumbs are evenly coated with the butter and no dry spots remain.
07 - Sprinkle the butter-coated cracker crumbs evenly over the top of the casserole. Bake for 30-35 minutes until the topping is golden brown and the sauce is bubbling around the edges.
08 - Remove from the oven and let the casserole rest for 5 minutes before serving. This allows the sauce to set slightly for easier serving.