This is a simple, very typical recipe from Lazio: Rome, in particular. It's a classic example of cucina povera, loosely translated as "humble cooking," appreciated all over the world. Just one secret: reserve some of the pasta water to make the sauce.
Bring a large pot of salted water to a boil. Cook pasta according to package instruction. Drain, reserving 2 cups of pasta cooking water to finish sauce.
In a large saucepan, heat the olive oil on a medium-high setting. Once hot, add the garlic to infuse oil. After about 30 seconds, once garlic just begins to sizzle, turn off heat before they turn golden. If the garlic gets browned it will impart a bitter flavor to the dish. Add the chili pepper.
Toss hot pasta with oil in the saucepan and cook on medium heat for 3 minutes. Add the pasta water a little at a time as needed to create a creamy sauce.
Note: The secret to this recipe is to avoid browning the garlic and overcooking the spaghetti, as well as adding pasta water to create a creamier sauce.