Cook spaghetti according to the package directions
Warm garlic in olive oil in a large skillet
When spaghetti is done, instead of draining it, lift it with tongs and let it drain a bit then add to the skillet so a little of the cooking water ends up in the skillet
Add red pepper flakes, Parmesan and salt and pepper to taste