Steps
1. Cook the spaghetti in boiling salted water according to package instructions until al dente, then drain.
2. While pasta cooks, heat olive oil in a pan over medium heat.
3. Add minced garlic and sauté for 1 minute until fragrant.
4. Add diced tomatoes, salt, and pepper; cook for 5 minutes until tomatoes soften.
5. Toss the cooked spaghetti into the tomato mixture.
6. Stir in chopped basil leaves and cook for another minute to combine flavors.
7. Serve on a plate and sprinkle with grated Parmesan cheese if desired.