Peel potatoes, if desired. (Optional.) Thinly slice potatoes (1/8" to 1/4") in even slices.
Add 3 Tablespoons butter to a saucepan over medium heat. Stir until melted.
Add the chopped onions and stir for about 3 minutes until the onions are soft.
Add minced garlic and thyme and stir for about one minute.
Stir in 3 Tablespoons flour.
Pour in heavy cream.
Add salt, pepper, thyme, and cayenne and stir.
Stir in 2 cups (8-ounces) of shredded sharp cheddar cheese. Stir until the cheese is melted and the sauce is smooth. Remove from heat.
Butter a baking dish or spray a baking dish with cooking spray.
Layer half of the sliced potatoes on the bottom of the baking dish
Pour half of the cheesy garlic cream sauce over the top of the potatoes.
Sprinkle with 1/2 of the remaining shredded cheddar cheese.
Repeat above 3 steps for the next layer.
Sprinkle the top of the scalloped potatoes with chopped chives, thyme, or chopped parsley.
Cover the casserole dish with aluminum foil.
Bake for 40 minutes in a preheated 375-degree F oven.
Remove the foil.
Sprinkle the remainder of the shredded sharp cheddar cheese over the top of the scalloped potatoes.
Bake for 20 more minutes or until the cheese is melted and the potatoes are cooked through.
Remove from oven. Garnish the Scalloped Potatoes with chopped chives, parsley, or thyme before serving.