01 - Preheat oven to 350°F. Lightly grease a 9x13-inch baking dish with butter or cooking spray.
02 - Bring a large pot of salted water to a boil. Add green beans and cook 4–5 minutes until just tender-crisp. Drain immediately and rinse under cold water to stop cooking process. Skip this step if using canned beans.
03 - In a large skillet over medium heat, melt 1 tablespoon butter. Add chopped onion and sauté until softened and translucent, about 3 minutes. Add minced garlic and cook 1 minute more until fragrant.
04 - In a large bowl, combine cooked green beans, sautéed onion and garlic, cream of mushroom soup, whole milk, shredded cheddar cheese, sour cream, salt, black pepper, and dried thyme. Mix thoroughly until all ingredients are evenly coated.
05 - Spread the green bean mixture evenly in the prepared baking dish, smoothing the top with a spatula.
06 - In a small bowl, combine crushed Ritz crackers with remaining melted butter. Toss until crackers are evenly moistened.
07 - Sprinkle cracker mixture evenly over the casserole. Bake for 30–35 minutes until sauce is bubbly around edges and topping is golden brown.
08 - Remove from oven and let stand 5 minutes before serving to allow casserole to set for easier scooping.