Example:
* I love to eat pizza, but I'm trying to eat healthier.
Here, both "I love to eat pizza" and "I'm trying to eat healthier" are complete sentences (independent clauses) that can stand alone. "But" joins them together, creating a compound sentence.
Important Note: When using "but" to connect two independent clauses, you must use a comma before it.