When should a comma be used

A comma can be used in several situations, including:

1. Separating items in a list or series: "I need to buy apples, bananas, and oranges."
2. Setting off introductory words or phrases: "In my opinion, the movie was great."
3. Separating nonessential information or phrases: "John, who is my best friend, helped me with the project."
4. Separating coordinate adjectives: "She has beautiful, long hair."
5. Separating two independent clauses joined by a coordinating conjunction: "I like to run, and my brother prefers to swim."
6. Setting off direct quotations: "He said, 'I will be there on time.'"
7. Separating dates, addresses, and other elements in an address or date: "She was born on June 5, 1990, in New York City."

It is important to note that there are many more rules and specific situations where a comma should be used. These are just a few common examples. The usage of a comma can vary depending on the context and style guide being followed.