Boil the spaghetti in boiling water and drain it in a colander.
Thinly slice the onion, bacon, and garlic.
Heat olive oil in a pan and sauté the garlic, bacon, and onion.
Add tomato sauce and simmer together.
Add the cooked noodles and mix well with the sauce.
Season with salt and pepper to taste.
Serve on a plate and sprinkle Parmesan cheese on top to finish.