Heat the oil in a 10-inch skillet over medium heat for about 30 seconds. Add the onions and garlic and cook until softened, about 3 minutes.
Add the ground beef and cook, breaking it up with a spoon, until no longer pink, about 8 minutes.
Stir in the crushed tomatoes, basil, oregano, salt, and pepper. Bring to a boil, then reduce the heat to low and simmer until the sauce thickens, 25 to 30 minutes.
Taste and adjust the seasoning with additional salt if needed. Serve with pasta or use as desired.
Notes
Take Time with the Onions and Garlic: Cook them until the onions are soft and fragrant. This step builds the flavor base of the spaghetti sauce, so avoid rushing it.
Brown the Meat Fully: Cook the ground meat until no pink remains before adding the tomatoes. Proper browning adds depth and prevents the sauce from tasting flat.
Simmer for Better Flavor: Let the sauce simmer for at least 20 minutes so the flavors develop. A longer simmer will deepen the taste, but avoid boiling, which can cause the sauce to reduce too quickly.