Preheat Oven: Preheat your oven to 350°F (175°C).
Sauté Vegetables: In a large skillet, melt the butter over medium heat. Add the chopped onion and cook until softened. Add the garlic and crumbled bacon and saute for an additional minute.
Make Roux: Sprinkle the flour over the onions and bacon and stir to combine. Cook for 1-2 minutes to remove the raw flour taste.
Add Liquid Ingredients: Gradually whisk in the chicken or vegetable broth and milk. Stir continuously to avoid lumps. Season with salt, pepper, and dried thyme (if using). Cook until the mixture thickens.
Combine with Green Beans: Stir in the condensed cream of mushroom soup until well combined. Add the frozen green beans, ½ cup of the fried onions, and the shredded cheddar cheese. Mix until the beans are coated in the creamy sauce.
Transfer to Casserole Dish: Transfer the green bean mixture to a greased casserole dish and cover it with aluminum foil.
Bake: Bake in the preheated oven for about 25-30 minutes or until the casserole is hot and bubbly.
Top with Fried Onions: Remove the casserole from the oven and sprinkle the remaining crispy fried onions evenly over the top.
Finish Baking: Return the casserole to the oven and bake for an additional 5-10 minutes or until the fried onions are golden brown.
Serve: Allow the green bean casserole to cool slightly before serving. And enjoy!