Em dash vs semicolon: which is more appropriate in the following examples?

Dashes can be used in place of parentheses to indicate an aside or qualifying statement. I don't think either has a place in any of your examples.

Generally speaking, for the same reason you're having a hard time understanding their use, it's a good idea to avoid using semicolons altogether. The semicolon is intended to separate two sentences where the second sentence clarifies or extends the first. In practice, they're often used incorrectly and there is ample evidence that they confuse readers and translation software. A comma or period would often suffice.

It's good advice to use the simplest punctuation possible. That often means using the simplest sentence construction possible as well. Here is how I would punctuate your examples:

English is not my first language. I'm having trouble understanding the punctuation, specifically semicolons and dashes.

Note here that the wording is more specific so that the second clause merely clarifies. It could be thought of as a contraction of this more verbose version:

English is not my first language. I'm having trouble understanding the punctuation. Specifically, I'm having trouble understanding semicolons and dashes.

Or, if you really felt the need to use that spare semicolon:

English is not my first language. I'm having trouble understanding the punctuation; specifically, I'm having trouble understanding semicolons and dashes.

Your second example is fine as is; it's completely clear in meaning as two sentences (see what I did there?).

Your third sentence provides a great example of the many ways to associate two sentences. The first is very clear, but awkward and wordy. The second is probably most confusing to readers because the second sentence is quasi-grammatical. "it" implies "The question" here. The third is a rather elegant construction to my native English comprehension. Does the conjunction "but" imply the same meaning to you, however?

The question isn't what you can take away from this. The question is what you can learn in the process.

The question isn't what you can take away from this; it is what you can learn in the process.

The question isn't what you can take away from this, but what you can learn in the process.

These all mean exactly the same thing. From your perspective, take the construction that makes the most sense and use that consistently in your writing. Much great writing can be done without any semicolons at all.

Finally, note that your last example is a rhetorically loaded construction in English. I'm sure "Not this, but that" phrasings are encountered in many languages. Here's a famous example:

Ask not what your country can do for you. Ask what you can do for your country.

In these cases, simple, repeated, parallel constructions work in your favor in spite of the punctuation:

It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness...

Be clear. Be consistent. Remember that many writers don't actually know the rules of punctuation. My apologies for rambling.


Here's an apt description, folks. Take note and enjoy.


In most cases, you cannot interchange em dashes and semicolons; however, there is one case that makes this possible. I mention this in the section on em dashes.

Em dashes are used for arbitrary "breaks" in syntax. Semicolons are used to conjoin directly related independent clauses.


Em dashes

Em dashes provide a brief escape from "grammatical" syntax so you can express or emphasize a word or idea that is loosely or abstractly connected to the subject of a given text—the word or idea may not logically follow the preceding clause, but adds to or expands on the latter's content. Types of clauses that serve this purpose include appositives, asides, interjections, and so on. Em dashes are also used to express long pauses.

At first glance, one may perceive em dashes and parentheses as interchangeable; however, this is only true in a syntactic sense—not semantically. In other words, you may use them to grammatically achieve the same sentence structure, but the affected clause's shade of meaning (or "delivery") will differ in each case.

Parentheses tend to focus on expressing "afterthoughts," terse explanations, and paraphrases that logically (concretely) follow clauses; em dashes, however, are more open-ended and carry more emphasis.

Because semicolons are a rather "one-dimensional" type of punctuation while em dashes are multipurpose, semicolons can sometimes be replaced with em dashes—but not vice versa. The main factor in choosing whether to use a semicolon or an em dash (if you're playing your cards right) is whether the clause that the punctuation introduces is more explanatory or expository in nature. If it's the former, use a semicolon; if the latter, use an em dash. As you have just witnessed, semicolons are excellent for achieving something called "parallelism." Both punctuations are suitable for elaboration.

Finally, there are cases that may allow you to swap a comma with an em dash, but only if the comma introduces a dependent clause that serves as a description of the subject preceding it (e.g. "He went to go talk to his neighbor, an inveterate alcoholic who fights trees in his backyard.") Once again, the em dash is preferable if you want to emphasize the description of the friendly neighbor.


Semicolons

Semicolons are used to transition to a clause that explains or elaborates on the one preceding it. Semicolons very often occur alongside a conjunction or a phrase that begins with one: "and," "but," "yet," "however," "although," and so on. Semicolons can only conjoin full-bodied, independent clauses; because of this, it is almost never possible to correctly replace an em dash with a semicolon.

Additionally, semicolons are used in long and verbose lists in which the use of commas to separate items may cause confusion or ambiguity (due to commas and other punctuation occurring within each item of the list).

One cannot use semicolons in place of parentheses or em dashes for various reasons that should be obvious by now: semicolons offer explanations or elaborations that are mostly more comprehensive than those that parentheses are intended to provide; unlike scatterbrained em dashes, semicolons stay on topic; and, as mentioned earlier, semicolons never lead to a fragment (a dependent clause that might be missing a subject, for instance).

Emphasis, another factor in choosing what punctuation to use, is normally not taken into consideration when a semicolon is needed, for a clause introduced by a semicolon may be too long—too concerned with an entire series of details—to emphasize a singular word or idea.

Beware: swapping a comma with a semicolon will dig a grave and throw the English language in it—without even building a coffin to the put the nail in.

In general, semicolons tend to be used in more "formal" and academic language, while em dashes are especially suitable for writing dialogue and employing the "stream-of-consciousness" style; regardless, no use of any given punctuation is restricted to one style of writing.


Conclusion

Make use of all tools at your disposal. Mastering syntax and punctuation is especially important in the English language because the comparably low range of inflections that English enforces necessitates proper arrangement of words, and I see (very subtle) syntactic mistakes that lead to semantic ones everyday, almost every time I read the news or virtually any amateur writing.

Here's an example of such a mistake:

Just like a checking account, you can open a health savings account in which you can keep funds that roll over from one year to the next!

Can you see the problem here? Here's a hint: it's not the punctuation. I'll let you folks pick your brains apart and find the "mistake."

Godspeed.