Bring a large pot of salted water to a rolling boil. Add the dry spaghetti and cook until al dente, about 8–10 minutes, then reserve 1/2 cup of the pasta cooking water and drain the pasta.
While the pasta cooks, melt the butter in a large skillet over medium-low heat. Add the minced garlic and sauté for about 1 minute until fragrant, taking care not to brown it.
Pour in the heavy cream and bring to a gentle simmer over medium heat. Simmer for about 10 minutes until slightly thickened, stirring occasionally. Season with kosher salt and black pepper.
Reduce the heat to low and add the drained spaghetti to the skillet. Toss to coat the pasta with the sauce, adding reserved pasta water a little at a time to reach your desired sauce consistency.
Stir in the freshly grated Parmesan until it melts into the sauce and evenly coats the pasta. Taste and adjust seasoning if needed.
Serve immediately, garnished with chopped fresh parsley if desired.