- I like dogs, but I don't like cats.
In this sentence, the comma is used to separate the two independent clauses: "I like dogs" and "I don't like cats."
However, a comma is not used after *but* when it is used to connect two parts of a compound sentence. A compound sentence is a sentence that contains two or more independent clauses joined by a comma and a coordinating conjunction (such as *and*, *but*, *or*, *nor*, *for*, *so*, or *yet*). For example:
- I like dogs but not cats.
In this sentence, the comma is not used after *but* because the sentence is compound, and the two parts are joined by the coordinating conjunction *but*.