Sauté the onion and garlic. Melt the butter in a large nonstick skillet over medium heat. Add the diced onion and cook until softened and translucent, about 3 to 4 minutes. Stir in the garlic and cook for 1 minute, until fragrant.
Add the corn. Add the frozen corn, sugar, half-and-half, salt, and black pepper. Stir to combine and cook for about 5 minutes, until the corn is heated through.
Whisk the slurry. In a small bowl or measuring cup, whisk together the milk and flour until smooth. Pour the slurry into the skillet and stir well.
Simmer until thick. Continue cooking, stirring occasionally, for 8 to 10 minutes, until the mixture thickens and becomes creamy.
Finish with Parmesan. Remove from the heat and stir in the Parmesan cheese until melted and well combined. Garnish with chopped parsley and freshly cracked black pepper, if desired. Serve immediately.