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. Once boiling, add spaghetti and cook for al dente texture.
In a large saucepan, heat the olive oil on a medium-high setting. Once hot, add the garlic. After about 30 seconds, once garlic becomes golden, add the chili pepper. Add 1/2 cup of the boiling pasta water to the saucepan and set aside until the pasta is done.
Once cooked, drain pasta and toss with hot oil in the saucepan for 2 minutes to coat well.
Note: The secret of this recipe is to avoid browning the garlic or overcooking the spaghetti.