Bring a large pot of water to a rolling boil and add a generous amount of salt.
Break the 8 oz spaghetti in half and add to the boiling water; reduce heat to maintain a gentle simmer and cook until al dente following the package time as a guide.
While the pasta cooks, remove the thick ribs from the chard and slice the leaves crosswise into strips, then wash and dry (use a salad spinner or pat dry with towels).
Measure and finely mince garlic to equal 2 tablespoons.
In the largest heavy frying pan you have, heat 1/4 cup olive oil over medium heat. Add the minced garlic and a pinch of red pepper flakes if using, and cook about 1 minute, stirring, until fragrant but not browned.
Add the sliced chard to the pan all at once and sauté 1–2 minutes, stirring, until the chard wilts to about half its volume and is coated in oil.
Carefully ladle or scoop out 1/4 cup hot pasta cooking water from the pot and add it to the chard, then reduce heat to low.
When the pasta is done but still slightly chewy, drain it in a colander and immediately add the hot spaghetti to the pan with the wilted chard.
Toss the pasta and chard together (use two forks or tongs) to combine, then add 1/2 cup coarsely grated Parmesan or Pecorino-Romano and toss again to coat.
Season with fresh ground black pepper to taste and serve hot with extra cheese at the table if desired.