add the onion and cook until tender, 7 minutes, then add the garlic and cook 1 minute. add the tomatoes, tomato paste, oregano, basil, and, if using, red pepper flakes. add salt and pepper and bring sauce to a simmer. reduce heat to medium-low and simmer, uncovered, until sauce thickens slightly--about 20 minutes.