Preheat your oven to 375°F (190°C). Grease a 9 × 13-inch baking dish lightly with butter or cooking spray.
Place the diced potatoes in a large pot of salted water. Bring to a boil and cook for about 8–10 minutes, until the potatoes are just fork-tender but not falling apart. Drain well and set aside.
Melt the butter in a medium saucepan over medium heat. Add the chopped onion and cook for 3–4 minutes, stirring occasionally, until softened. Stir in the minced garlic and cook for another 30 seconds.
Sprinkle the flour over the onion and garlic mixture, stirring continuously for about 1 minute. Gradually whisk in the milk and cook until the sauce thickens, about 3–4 minutes.
Remove the saucepan from the heat. Stir in the sour cream, 1 cup of shredded cheddar cheese, salt, black pepper, and paprika until the cheese melts and the sauce becomes smooth and creamy.
Add the drained potatoes to a large mixing bowl. Pour the cheese sauce over them and gently stir until all the potatoes are evenly coated.
Transfer the potato mixture to the prepared baking dish and spread it evenly. Sprinkle the remaining 1/2 cup of shredded cheddar cheese over the top.
Bake for 30–35 minutes, until the casserole is bubbling around the edges and the cheese on top is melted and golden.
Remove from the oven and let it rest for 5–10 minutes before serving. Sprinkle with chopped fresh parsley for a finishing touch.