Bring a large pot of salted water to a boil.
Add pasta and cook according to package instructions until al dente.
While the pasta cooks, melt butter in a large skillet over medium heat.
Add minced garlic and sauté for 1-2 minutes until fragrant.
If using, add red pepper flakes and stir.
Drain the pasta, reserving 1/2 cup of pasta water.
Add the drained pasta to the skillet with garlic butter.
Toss to coat the pasta in the garlic butter sauce.
Add reserved pasta water gradually until desired consistency is reached.
Season with salt and pepper, then stir in Parmesan cheese.