Here we have the lowly comma, so often ignored, despised, treated as the red-headed stepchild...overworked and underused both (amazing the talents the comma has) and too often forced to attempt the job some other punctuation mark should do. Moreover, fashions change. Once upon a time, writers used many more commas, often, you will notice, inserting commas, where, today, they would not be used. (Sentence above is self-referential.) More recently a concern that commas were an endangered species has led to the conservation of commas and the removal of commas to places of safety in the typographer's keeping. (Ditto.) One reason for this is the decreasing frequency of reading aloud. When few were literate, and one person might read to a dozen others, commas helped signal to the reader where to breathe, where to pause, how to bring the raw text to life. More commas are a help--they are like stage directions to a theatrical company that's going to put the play on, while the person who just reads the play in a book doesn't need them. Or doesn't need as many.
Modern grammars and style books have lots of rules for comma use (and avoidance) and I'm not covering all of them here because it's in the basics that mistakes stick out the most. If a copyeditor someday deletes one of your commas, in a passage where it would have been acceptable twenty or fifty or a hundred years before, this is not a disaster. (And you can "stet" the change if you feel it matters...I sometimes do, depending.) But if you put a comma where a semi-colon should go, or where no comma should ever go and never did belong, that's a problem.
Let's start with what commas should never be asked to do.
A comma cannot substitute for a semicolon, when a semicolon is needed. Thus, a comma cannot be used to connect the parts of a compound sentence: "I went upstairs, I made my bed" is wrong. That comma needs to be a semicolon or a colon. With comma alone, it is a run-on sentence.
Commas have two main functions: to separate grammatical structures, thus making it clear which words belong to which adjacent "controller," and to enforce a prosody, a rhythm, of pauses and emphases, on the text. We'll deal first with the grammatical function.
Complex sentences with nested clauses and phrases benefit from having them marked off by commas as an aid to readers. Readers see a long string of words without any helpful commas as daunting.
Here's a fake sentence of the type that might appear in a history book:
On the first day of October in the year 1528 the arrival of a letter from the papal representative at the court of the Grand-Duke became the instigation for the first of the bloody uprisings among the peasants and lesser nobles which resulted finally in the dissolution of the Duchy and the formation of two opposing realms one of which was headed by the Grand-Duke's second son and one by the eldest son of the Grand-Duke's former chancellor.
It's not easy to read, is it? Now look at it this way:
On the first day of October, in the year 1528, the arrival of a letter from the papal representative at the court of the Grand-Duke became the instigation for the first of the bloody uprisings among the peasants and lesser nobles which resulted finally in the dissolution of the Duchy, and the formation of two opposing realms, one of which was headed by the Grand-Duke's second son, and one by the eldest son of the Grand-Duke's former chancellor.
It's still a mouthful, but at least there are some clues.
Commas can set off phrases and clauses both long and short: after the ball, between the mountains and the sea, by the time the boat reached New Zealand, when we get back from vacation, etc. The goal is clarity. Sometimes ("In the morning I eat breakfast") a comma is not needed for clarity, and it becomes a matter of habit and/or style. Quite often, if you feel you need a comma in a short sentence like this, what you've got is an inverted structure (that is, the natural order would be "I eat breakfast in the morning") and at that point you need to question why you inverted the order. Do you need that inverted order? If so, then decide whether to give the reader the conventional comma ("In the morning, I eat breakfast") or create the mild tension of leaving it out. In fiction writing, these little subtleties can be useful in setting a mood or showing character; in nonfiction, they're usually less needed and less effective.
Commas can clarify the items in a list, especially where some items include several words: She bought brown wool yarn, tied-dyed cotton T-shirts, cotton socks in all colors, and two loaves of bread. With a different placement of commas, you could have a different list: "She bought brown wool, yarn tie-dyed, cotton T-shirts, cotton, socks in all colors, and two loaves of bread. In the unusual (but not unknown) event that you have a series of sentences, such as "I want a dog, she wants a cat, and Billy wants a pony" tied together in one, the comma at the end of a complete sentence, without a following conjunction, signals that you are making a list.
Commas set off "parenthetical" expressions. "Mrs. Jones, the fifth-grade special-ed teacher, said that..." Such expressions can be quite long. "Mrs. Jones, who was Billy's fifth-grade teacher two years ago and heads the elementary school's special-education committee, said that..." "The flagship Artemis, which had been short up badly in a previous battle and was only now recommissioned after a year in dock for repairs that included replacement of two gun turrets, appeared on the horizon."
Commas used for style, not clarity--to impose a rhythm on a passage--are more likely to be snarked at by copyeditors, and writers may need to defend them fiercely, especially in this age of comma conservation.
Even then, the writer cannot just throw commas at the text, inserting one whenever a string of words looks too long. Read the passage aloud, with the emphasis you want, and insert commas only where they will help a reader reach the same decisions about pauses, changes of intonation, etc.
As an example, here's a bare, uncomma-enhanced passage: Here at the end of the world we stand--we who have no one before us and no one behind us.
Try reading aloud these differently-punctuated versions:
Here, at the end of the world, we stand--we, who have no one before us, and no one behind us.
Here at the end of the world, we stand--we who have no one before us, and no one behind us.
Here at the end of the world we stand--we, who have no one before us and no one behind us.
Each version has a slightly different rhythm, a different emphasis, and every comma (or lack of it) makes that difference. Readers--even without reading aloud--"hear" slight pauses with every comma (that's why commas are included as "stops" in grammar) and also respond to the groupings commas impose. Single words set off by a comma are spoken differently, heard differently, given a different shade of importance. If you tune your ear to these things (and reading aloud is the best way to do that) you can begin to choose commas to guide readers to your meaning, your sense of the right interpretation. To me, one of those versions sounds like a tired voice speaking, a voice almost despairing., not just alone but lonely. Another sounds eager, adventurous, proud., delighted to be there where no one has been, and no one is following.
Every choice of punctuation affects your readers, just as every choice of word, phrase, clause, sentence length and structure does...but with the comma you have a very flexible, subtle tool once you grasp its possibilities. It's so small, it slides in so easily, it guides the reader so gently and almost without the reader's notice....learn it, play with it, use it well.