Talking generally we use commas in two main ways.
First, to separate lists of words or similar items in a sentence:
He was a big, bad, bald, belligerent, dog.
Second, to separate clauses in a sentence; it's used to show a slight pause and, if you like, to give time for the reader to take in what's gone before:
My doctor, who is a man of great character, rides a bicycle to his surgery each morning, which I find rather annoying for some unknown reason.
These two uses are explained more below (with other uses as well thrown in for good measure).
We can use commas to separate a list of nouns:
noun, noun, noun, and noun
The room was full of newspapers, books, periodicals, magazines, and journals.
Note that we don't always have a comma before the final item in the list and instead use and to separate it - this is known as an Oxford Comma - see the link below.
In a similar way, commas are used to separate a list of adjectives.
adjective, adjective, adjective noun
a big, hairy, old dog
In this case above the 3 adjectives refer to the dog (the noun). However, if one of the adjectives describes another adjective, then we don't use a comma. Take a look at this:
the deep, blue sea
the deep blue sea
In the first example, the sea is both blue and deep so both adjectives are talking about the sea. However, in the second example the sea is of a deep blue color and the adjective deep refers to blue.
Commas are used to separate lists of adverbs:
You need to work quickly, confidently, and carefully.
NB The same issue of the Oxford comma applies here.
Commas are also used to separate lists of phrases.
We had a great time this weekend, visiting friends, eating at our favorite restaurant, walking in the park and watching movies.
Optionally you can use a comma to mark off the last phrase even though there is an and there. This is done to help in reading and understanding, especially if the list is rather long. It is also useful if some of the phrases also contain and.
We had a great time this weekend, visiting friends, eating at our favorite restaurant, walking in the park, going to the movies, taking the kids to a museum and then the park, and going to mall to buy a new skateboard for Tim and a birthday present for Ginny.
In conditional sentences we can use a comma to separate the clauses when the if-clause comes first (but not if the if clause is second):
If you don't eat yer meat, you can't have any pudding!
How can you have any pudding if you don't eat yer meat?! 1
Adverbial clauses (of which the if-clause above is an example) all work like this:
Although you didn't eat your meat, I'm going to let you have your pudding anyway.
I'm going to let you have your pudding even though you didn't eat your meat.
When writing direct speech we use commas to show where the speech finishes and the reporting begins. The commas always sit inside the quotation marks:
"It's Friday," said Joe.
However if the direct speech ends with a question mark or an exclamation mark then the comma is omitted:
"Thank God it's Friday!" said Joe.
Note for more on this, see the Punctuating Direct Speech link below.
When an adverb refers to the entire sentence it takes a comma. Common sentence adverbs include: however, on the other hand, moreover, etc.
It would be useful to go today, however.
We could leave now, on the other hand, we could leave tonight.
Moreover, I wish to see the reports on my desk before I leave tonight!
We use commas to enclose the person being addressed in the sentence.
Where are you going, Jack?
Hey, you, what's your name?
John, what's up?
Oy, you idiot, why are you driving so fast?
We can use a comma to mark off an aside or afterthought. (This can also be done by brackets.)
I went to my mother's house, as I normally do on Thursdays, with a bunch of flowers.
I went to my mother's house (as I normally do on Thursdays) with a bunch of flowers.
Note that when we use brackets instead of commas, it makes the afterthought even more distant.
We use commas to mark off interjections. This includes words like yes, no and right which act like interjections in some cases.
Oy, where are you going?
D'oh, that's not what I meant.
We'll come with you, yes?
Right, what's happening here?
Commas are used to mark off question tags.
You're English, aren't you?
She likes me, doesn't she?
Commas are used to mark off participle phrases:
Not knowing, can't say.
Watching the film, I suddenly felt sick.
Punctuation in English - a general guide to punctuation in English
Oxford Commas in English Punctuation - the case of the Oxford comma and whether to use it or not
Punctuating Direct Speech - more on punctuating direct speech with commas
1. Another Brick in the Wall, Roger Waters, 1979photo credit ICAL TEFL via cc