Bring a large pot of salted water to a boil.
Add spaghetti and cook until al dente according to package instructions.
Reserve ¼ cup of the pasta water, then drain the pasta.
Heat olive oil in a large pan over medium-low heat.
Add sliced garlic and cook gently until soft and lightly golden. Do not let it burn.
Add red pepper flakes if using.
Add the cooked spaghetti to the pan and toss well.
Pour in a little pasta water to help coat the pasta smoothly.
Season with salt and mix well.
Remove from heat, garnish with parsley and parmesan if desired.
Serve immediately and enjoy.