Heat olive oil in a saucepan over medium heat.
Add minced garlic and the halved onion to the pan and sauté until the onion is soft and translucent, about 5-7 minutes.
Stir in the tomato paste and cook for another 1-2 minutes to allow it to caramelize slightly.
Pour in the can of crushed tomatoes and stir well. Add dried oregano, basil, salt, pepper, and red pepper flakes if using.
Bring the sauce to a simmer, then reduce the heat to low.
Let the sauce simmer for about 20-25 minutes, stirring occasionally, until it thickens to your desired consistency.
Taste and adjust seasoning if needed.
Once done, remove from heat and let it cool slightly.
Remove the onion and discard.
Stir in the grated Parmigiano Reggiano until it's fully incorporated.