Preheat oven to 350 degrees F.
Spray 2-quart casserole dish with cooking spray.
Bring a pot of water to boil.
Once boiling, add green beans and cook them for 5-6 minutes, until they are bright green.
Drain green beans, rinse with cold water, and set aside.
In large skillet, melt butter over medium heat.
Add diced onion and cook for 5-6 minutes, until they are softened and translucent.
Add garlic and cook one more minute.
Add flour, and stir well to combine. Cook for another minute, stirring continuously.
Slowly add milk, stirring continuously, then slowly add the broth.
Bring mixture to a simmer, then lower heat and let simmer for 7-10 minutes, until it has thickened.
Season with salt and pepper.
Add green beans to sauce and stir to combine, then pour into prepared casserole dish.
At this point, casserole can be covered and refrigerated.
If refrigerating, top with fried onions right before baking, then bake 30 minutes.
If not refrigerating, top with fried onions, bake 20-25 minutes.