Preheat the Oven: Start by preheating your oven to 375°F (190°C).
Prepare the Potatoes: Slice the potatoes thinly and set them aside. Similarly, slice the onions and mince the garlic.
Make the Cheese Sauce: In a saucepan, melt butter over medium heat. Add flour to create a roux, then slowly whisk in the milk until smooth. Stir in cheddar, mozzarella, and Parmesan until the cheese sauce is velvety. Add dried or fresh herbs
Layer the Ingredients: In a greased baking dish, arrange a layer of sliced potatoes, followed by onions and minced garlic. Pour a portion of the cheese sauce over the layers. Repeat until all ingredients are used.
Bake to Perfection: Cover the dish with foil and bake for an hour and 10 minutes. Uncover and broil for an additional 10 minutes or until the top is golden brown and the potatoes are tender.
Serve and Enjoy: Let it rest for a few minutes before serving. Garnish with fresh herbs if desired and savor the creamy, cheesy goodness!