Bring a large pot of salted water to a boil and cook the spaghetti until al dente according to the package instructions. Reserve ½ cup of the pasta water, then drain.
Heat the olive oil in a large skillet over medium-low heat.
Add the sliced garlic and cook gently until lightly golden and fragrant. Do not let it burn.
Stir in the red pepper flakes and cook for about 30 seconds.
Add the cooked spaghetti to the skillet and toss well to coat with the garlic-infused oil. Add a splash of reserved pasta water if needed to help the sauce coat the pasta.
Mix in the chopped parsley and season with salt and black pepper to taste.
Serve immediately with grated Parmesan cheese, if desired.