This is a great question because commas are certainly complex. I have several examples.
Commas are not needed to separate essential elements. For example, “The students who always come to class learn new information everyday.” However, commas are needed to set off nonessential elements in a sentence. For example, “Bananas, which happen to be my favorite fruit, are the main ingredient for this recipe.”
Commas are used to set off all geographical names, items in dates (except the month and day), addresses (except the street number and name), and titles in names. For example, “Kansas City, Kansas, is near my home.” In this correct example, the city and state are separated by a comma. An example of a comma separating a title is the following, “Johnathan Nelson, MD, will be our expert speaker today.” MD stands for medical doctor and is Johnathan Nelson’s title.
Commas should also be inserted to prevent confusion or misreading. For example, “To Sarah, Jerry is like a friend and father figure.” In this correct example, the comma separates the two names, Sarah and Jerry. If there were no comma the sentence would look like this, “To Sarah Jerry is like a friend and father figure.” The sentence does not make sense upon first reading and appears incomplete. The reader may also think that Sarah’s last name is “Jerry”.
These examples should help you out!