when there are two separate independent clauses that are illustrating a similar idea but that would be grammatically incorrect to keep in the same sentence. If you have two sentences separately that illustrate the same idea, you can change the period in the middle to a semicolon. For example:
Once upon a time, there was a bird that lived in a tree. I always wondered when the bird would try to fly. This is also grammatically correct: Once upon a time, there was a bird that lived in a tree; I always wondered when the bird would try to fly.
when the sentence is already using commas and you need to separate a list of items, such as:
I decided to buy many things at the store, such as shoes, socks, and clothes; food, water, and drinks; and a computer. It is a list inside a list, therefore the bigger list is separated by semi-colons and smaller inner-lists are separated by commas.