Cook Pasta: In a large pot, boil water and cook spaghetti until al dente. Reserve 1 cup of pasta water for later use, then drain the spaghetti.
Cook Bacon: While the pasta is cooking, fry the bacon or pancetta in a large skillet until crispy. Add garlic and cook for about a minute. Remove from heat.
Mix Eggs and Cheese: In a bowl, whisk together the eggs, Parmesan cheese, salt, and pepper.
Combine: Add the drained spaghetti to the skillet with bacon. Pour the egg and cheese mixture over the pasta, quickly tossing to coat the pasta and prevent the eggs from scrambling.
Adjust Consistency: If the sauce is too thick, add reserved pasta water a little at a time to reach the desired consistency.
Garnish and Serve: Serve immediately, garnished with parsley if desired.