Boil the spaghetti noodles in boiling water.
Finely chop the onion and garlic.
Heat olive oil in a pan and sauté the garlic and onion.
Add tomato sauce and bring to a simmer.
Add the cooked noodles to the sauce and toss well.
Season with salt and pepper to taste.