A comma should always be used before and after combining two separate sentences. A comma is required after but only if you're using it as a literary technique to bring attention to anything. If your audience will understand that something else was meant, then there's no need for a comma.
You should use a comma before joining two separate phrases. I'd want to go for a stroll, but it's pouring. Here's a hint: Commas might be perplexing, but they don't have to be. They're easy to insert correctly into your writing.
Using a Comma
After transition words and phrases that begin a sentence, use a comma: although, thus, on the other hand, for example, and so on. In the midst of a sentence, use a pair of commas to separate transition words and phrases, as well as clauses that are not vital to the sentence's content.
The following are the general guidelines for commas and time phrases: Use a comma after the time phrase if it appears before an independent clause or sentence. There is no need for a comma if the time phrase follows an independent clause or sentence. For example, "Call me when you get home" does not require a comma because calling is an independent verb phrase. "I call him every night at 9" requires a comma because he's the subject of the sentence that follows.
Here's the lowdown: When the if-clause comes before the main sentence, put a comma after it. There is no need for punctuation if the main sentence comes before the if-clause.
For example, "If it rains on Sunday, we'll go to the museum." (comma needed)
After a dependent clause that begins a sentence, use a comma. However, if a dependent clause concludes the sentence, a comma is no longer required. Here, the last phrase ("makes me feel better when I hurt myself") is a dependent clause that does not need a comma after it.
1. Separate independent sentences with commas when they are connected by any of the following seven coordinating conjunctions: and, but, for, or, nor, so, yet. The game was ended, but the fans refused to leave. This book is written for readers who want to learn more about autism spectrum disorders.