Prep everything first. Before you turn on the stove, slice the garlic and add it to the olive oil in a small bowl. Place in the fridge while the pasta cooks. Having the garlic ready - and already sitting in the oil - starts to infuse the garlicky flavor.
Cook the pasta. Bring a large pot of well-salted water to a rolling boil. Add the gluten-free spaghetti and cook according to package directions until just al dente. Reserve ½ cups of pasta water, then drain and set the pasta aside.
Start the garlic in cool oil. Place the sliced garlic and olive oil together in a large skillet or use the same pot used to cook the pasta. Set the heat to medium-low and warm the oil slowly, stirring occasionally, until the garlic becomes fragrant and lightly golden - about 1–2 minutes. Starting the garlic in cool oil gives you better control and prevents burning.
Set the heat to medium and add the crushed red pepper flakes to the skillet and continue cooking until the garlic is lightly golden and fragrant, about 1 minute. Adding the red pepper flakes directly to the warm oil helps bloom the spice and deepen the flavor. Be careful not to let the garlic burn.
Remove skillet from the heat and add the cooked spaghetti directly to the skillet and toss gently to coat in the garlic oil.
Adjust with pasta water (if needed). Add reserved pasta water a little at a time only if needed, tossing until the pasta is glossy and evenly coated. Not all pasta brands need it, so add just enough to loosen the sauce.
Finish with cheese. Divide the pasta between plates, and finish with a generous helping of freshly grated cheese before serving.