When should a comma be used

A comma should be used in the following situations:

1. To separate items in a list: "I bought apples, bananas, and oranges at the grocery store."
2. To separate two independent clauses in a compound sentence: "I like to dance, and my brother likes to sing."
3. To separate introductory words or phrases from the rest of the sentence: "However, it was raining heavily, so we decided to stay indoors."
4. To separate nonessential information or interrupting phrases: "John, my best friend, is coming to visit me tomorrow."
5. To separate coordinate adjectives: "She has beautiful, long hair."
6. To separate contrasting or opposing elements: "She was tired, yet she continued to work hard."
7. To separate a direct quotation from the rest of the sentence: "He said, 'I'll be there in five minutes.'"
8. To separate a dependent clause from an independent clause when the dependent clause comes before the independent clause: "Although she was tired, she decided to go for a run."

However, it is important to note that comma usage can vary depending on the specific style guide or the specific context of the sentence.