From The Grammarly Blog:
What is a semicolon?
Semicolons (;) are as basic as a period stacked on top of a comma. Does that mean you can use it like either one? Don’t get your hopes up. But don’t let this punctuation mark get you down either.
How to use a semicolon correctly
The most common use of the semicolon is to join two independent clauses without using a coordinating conjunction like and.
Do you use a capital letter after a semicolon? The general answer is no. A semicolon should be followed by a capitalized word only if the word is a proper noun or an acronym.
We can go to the museum to do some research; Mondays are pretty quiet there.
Remember, semicolons are not interchangeable with commas or periods. Instead, they’re somewhere in between: stronger than a comma but not quite as divisive as a period. Sounds pretty cunning to us.
Here are the rules for using semicolons correctly; we hope you’re taking notes.
1 Use semicolons to connect related independent clauses
You can use a semicolon to join two closely related independent clauses. Let’s put that another way. The group of words that comes before the semicolon should form a complete sentence, the group of words that comes after the semicolon should form a complete sentence, and the two sentences should share a close, logical connection:
I ordered a cheeseburger for lunch; life’s too short for counting calories.
Martha has gone to the library; her sister has gone to play soccer.
The examples above are each made up of two complete, grammatically correct sentences glued together.
That’s exactly why you can’t substitute a comma for a semicolon. Using a comma instead of a semicolon in the sentences above would result in a comma splice. And there’s nothing as painful as a comma splice.
2 Skip the coordinating conjunction when you use a semicolon between two independent clauses
A semicolon isn’t the only thing that can link two independent clauses. Coordinating conjunctions (that’s your ands, buts, and ors) can do that too. But you shouldn’t use a semicolon and a conjunction. That means that when you use a semicolon, you use it instead of the ands, buts, and ors; you don’t need both.
Here’s a hint: You know how you can use a comma and an and to link two related ideas? Think of the period that forms the top part of the semicolon as a replacement for and.
I saw a magnificent albatross, and it was eating a mouse.
I saw a magnificent albatross; it was eating a mouse.
You need a comma plus something to avoid a comma splice. That something can either be the right conjunction or the period that turns a comma into a semicolon.
A semicolon can replace a period or a comma and a coordinating conjunction to demonstrate contrast between independent clauses instead of agreement. This is part of the same rule, but the conjunction in question is but instead of and. In other words:
This is part of the same rule; the conjunction in question is but instead of and.
To summarize, a semicolon links up two related ideas by narrowing the gap between the ideas of two separate sentences or by replacing a coordinating conjunction between the ideas. That goes for showing contrast too: just because two ideas are opposed or contradictory, that doesn’t mean they aren’t related closely enough to earn themselves a semicolon.
Link to the rest at The Grammarly Blog