Dice the tomato and onion.
Boil spaghetti noodles in hot water.
Heat olive oil in a pan, then sauté minced garlic and onion.
Add the diced tomato and continue sautéing.
Add the cooked spaghetti noodles to the pan and toss together.
Season with salt and pepper.
Sprinkle parsley or basil to taste.