The rules about commas can make a normal person crazy! But we mostly use the four rules this video talks about:

The Four Uses:
1. separating extra information from the subject and verb
2. separating introductory information from the main part of the sentence
3. separating two sentences that are joined by one of the “FANBOYS”
4. separating items in a list of three or more things

For a lot more about commas, check out this handout from The University of North Carolina-Chapel Hill Writing Center.