Prepare the tomatoes: If using fresh tomatoes, blanch them by placing them in boiling water for about 1 minute, then transferring them to an ice bath. Peel off the skins, remove seeds (optional), and chop them. If using canned tomatoes, open the cans and set aside.
Sauté the aromatics: In a large skillet or saucepan, heat olive oil over medium heat. Add the chopped onions and garlic and sauté for about 3-5 minutes until softened and fragrant.
Add tomatoes: Add the prepared fresh or canned tomatoes to the pan. Stir to combine, then bring to a simmer. Let the sauce cook for 15-20 minutes, stirring occasionally. If you prefer a smoother sauce, you can use a blender or immersion blender at this point.
Season: Add the dried or fresh herbs (basil, oregano), red pepper flakes, black pepper, and balsamic vinegar (if using). Stir to combine and let the sauce simmer for an additional 10 minutes to allow the flavors to meld together.
Adjust consistency: If the sauce is too thick, add water or vegetable broth a little at a time until you reach your desired consistency. Taste and adjust seasoning if needed.
Serve: Once the sauce is ready, pour it over your favorite pasta or use it as a pizza sauce. Garnish with fresh herbs if desired.