Bring a medium pot of salted water to a boil. Add the spaghetti and cook until al dente, about 8 minutes. Reserve 1/4 cup of the pasta water, then drain.
Melt the butter in a 10-inch skillet over medium heat. Add the lemon zest and garlic and cook, stirring, for 1 minute. Stir in the lemon juice.
Add the cooked spaghetti to the skillet. Pour in 2 tablespoons of the reserved pasta water and add 2 tablespoons of the Parmesan cheese. Toss until the pasta is coated and the sauce thickens.
Remove from heat. Taste and add a pinch of salt if needed. Add more pasta water if the sauce looks dry. Transfer to a bowl and finish with extra Parmesan and fresh basil or parsley, if using.
Notes
Have everything ready before you start. Pasta al limone cooks quickly, so measure your ingredients and read through the recipe first to avoid rushing.
Salt the pasta water well. Use 3/4 to 1 teaspoon of salt for every 4 cups of water. Properly seasoned pasta makes a noticeable difference in the finished dish, especially in simple lemon pasta recipes.
Reserve the pasta water. The starchy cooking water helps loosen the sauce, adds flavor, and helps the lemon butter sauce cling to the pasta. Add it a little at a time until the sauce looks glossy and coats the noodles.