Preheat the oven to 350 degrees F. Get a 9x13-inch baking dish (or something equivalent) and set it aside.
To the medium saucepan, set over medium heat, add the butter. When melted, add the garlic and cook for about 1 minute, until fragrant. Add the flour and stir until combined with the butter; cook for 1 minute. Pour in the milk and bring to a simmer, stirring frequently in order to prevent any lumps. Cook until mixture begins to bubble and thicken, about 5 minutes. Turn the heat off and mix in the Gruyère cheese, leaving 1/4 cup for the top. Stir until melted. Give it a taste and add salt and pepper to your liking. I added about 2 teaspoons of salt and a teaspoon of freshly ground pepper.
To the baking dish, add an even layer of the potatoes. Add a few spoonfuls of the cheese sauce and top with a few dollops of goat cheese. Repeat until you’ve worked through all of the potatoes and cheese sauce. Cover with foil and transfer to the oven to bake for 1 hour and 15 minutes.
Remove the foil and sprinkle the last bit of cheese on top. Return to the oven and bake for an additional 15 minutes, until golden brown.