There are three situations in which to use the comma.
Use a comma to separate three or more items in a list.
For breakfast there are sausages, bacon, beans and tomato available.
The comma before “and” is usually removed. However, if the last two items in the list could merge together, it is better to separate them with a serial comma to avoid confusion. This is the only time it should be used.
My favourite ice cream flavours are strawberry, chocolate, banana, and toffee.
This shows that banana is a separate flavour to toffee, so people don’t think it is “banana and toffee”.
To separate introductory parts
Use a comma to separate the introductory part of a sentence from the main part.
Despite his misgivings, the scientist felt the experiment went well.
Use a comma if the introductory part of the sentence changes the meaning.
Sadly, the numbers showed he had lost the election.
Use a comma if the introductory part of the sentence can merge into the sentence itself.
Inside, his heart was beating fast
Inside his heart was beating fast
The comma can be left out if the introductory part of the sentence is very short and doesn’t merge.
Soon the statistics will be on the website.
To separate asides in a sentence
Use a comma to separate anything that is not vital to understanding the meaning of the sentence. There should be a comma at the beginning of the aside and at the end.
The monthly death statistics, not always the most cheerful, were always informative.