A semicolon is used to join two independent ideas or clauses that could be separate sentences on their own, but are, in some way, essentially connected. Generally, the use of the semicolon is a stylistic (and therefore optional) decision. Semicolons may be used to join ideas that are closely related because of causality or some other association. For example:
I didn't get much sleep last night; I'm exhausted. (One of these ideas is the result of the other.)
None of the candidates presented much substance; they tended to be vague. (One of these ideas clarifies or re-emphasizes the other.)
Those two sentences are grammatically correct. It's good form, though, to use what's called a "conjunctive adverb" after a semicolon. Conjunctive adverbs are words or phrases like "therefore," "however," "whereas," "by contrast," "furthermore," et cetera.
Here are the same two examples using a conjunctive adverb. Note that you put a comma after the conjunctive adverb:
I didn't get much sleep last night; therefore, I'm exhausted.
None of the candidates presented much substance; in fact, they tended to be vague.
* Semicolons have another use that pertains to the creation of lists, but that's a different topic.