Heat olive oil in a medium pot over medium heat.
Add the onion and sauté until soft, about 3 minutes.
Add the garlic, a pinch of salt and red pepper flakes, then cook for 1-2 minutes longer until the garlic is fragrant.
Add the canned tomatoes, then use a wooden spoon to smash and break them into pieces.
Add a bay leaf and tomato paste (if using), along with about ½ - 1 cup of water, depending on the consistency of your tomatoes and how thick you want your sauce.
Cover the pot and let it simmer for 20 minutes.
Taste and season with more salt and pepper as needed. If the sauce is too acidic or tastes bitter, add a small pinch of sugar to balance the flavors.
Add fresh basil or parsley (if using) right before serving to preserve their flavor.