Bring a large pot of salted water to a boil and cook the pasta until al dente according to the package instructions.
Before draining, reserve 1 cup of the pasta cooking water, then drain the pasta.
Heat the olive oil in a large skillet over medium heat. Add the minced garlic and cook for 30–60 seconds, until fragrant.
Reduce the heat to low and stir in the ricotta cheese, Parmesan cheese, and ½ cup reserved pasta water until smooth and creamy.
Add the cooked pasta and toss until every piece is coated in the sauce. If needed, add more reserved pasta water a little at a time until the sauce reaches your desired consistency.
Season with salt and black pepper to taste.
Stir in the chopped parsley or basil and optional red pepper flakes or lemon zest.
Serve immediately with extra Parmesan and fresh herbs on top.