Semicolon in a sentence is used to separate two main clauses that are related to each other but can stand on their own. You can also use a semicolon if you want to join several things if equal weight. Here are a few examples of when to use a semicolon: We wanted four books; we were about to go to the library. I like dogs; however, I hate the way they trash the place.
The cat is white; it is also grumpy. I like dogs: they give us joy, which is what we wanted; they give us peace, which is what we also wanted; and they give us company, which is why we adopted him. A word of advice: Do not use a semicolon if you are not using an independent clause, because comma is what you need to use.