There are many different ways to use a comma, below are examples of the more common rules of usage.
1. A comma is used to separate words and word groups in a simple series of three or more items.
I love fish, chicken, beef and lamb.
2. A comma is used to separate two adjectives when the adjectives are interchangeable.
He is a strong, healthy man. He is a healthy, strong man.
3. A comma is used in a conjunction.
He drives very well, but often too fast.
4. In sentences where two independent clauses are joined by connectors such as and, or, but, put a comma at the end of the first clause.
He drove all the way to the beach, and had a swim.
5. A comma is used after certain words that introduce a sentence, such as well, yes, why, hello and hey.
Yes, I agree that the winter has been very mild.
6. A comma is used to highlight and separate expressions that interrupt the sentence flow; nevertheless, after all, by the way, on the other hand and however.
I want to visit my parent’s house this weekend, on the other hand, I would like to finish my assignment.
7. A comma is used to set off quoted elements.
“The staff of the hospital arrive between 10am and 11 am each day,” Peter said.
8. A comma is used to set off phrases that express contrast.
The whole of the city was covered in smoke, except the hill top.