Peel the onion, cut into small cubes and fry in olive oil. Then continue to steam the onion at medium temperature until translucent and deglaze with the sherry. Then add both cans of tomatoes and the tomato paste and stir vigorously.
Now you can (while the sauce continues to simmer on medium heat) peel the garlic and squeeze it directly into it. Then taste the sauce with the pepper, salt and herbs.
While you are now cooking the pasta, the sauce can simmer on a low flame.