Melt Butter, Onion, and Garlic over medium-low heat in a sauté pot. Sauté until Onions are soft, about 3 minutes. Add Flour and continue to sauté for 1-2 minutes stirring constantly.
Reduce heat to low. Add a small amount of liquid to the sauté pot at a time, whisking to thicken. The mixture will become very thick, continue adding a little bit of liquid at a time, whisking until smooth.
When all of the liquid has been added, bring to a boil over medium heat while continuing to whisk.
Add Salt and Pepper and let boil for 1 minute.
Taste. Add more Salt and Pepper if needed.
Remove from heat and add Cheese (if making au gratin) stirring to combine.
ASSEMBLY
Grease a 9"x13" baking dish.
Place 1/3 of the Potatoes in the bottom and season with Salt and Pepper.
Pour 1/3 of the cream sauce over layer.
Repeat layers ending with cream sauce. Cover and bake for 45 minutes.
Uncover and bake for an additional 35-45 minutes or until golden brown and potatoes are tender.
Optional: Broil on high for 3-4 minutes to obtain a golden top.
Allow to rest, uncovered, for 15 minutes before serving.