An **em-dash** `—` is typically used to act as a comma or parenthesis to separate out phrases—or even just a word—in a sentence for various reasons (i.e. an appositive). Examples where an em-dash should be used:

- School is based on the three R’s—reading, writing, and ’rithemtic.
- Against all odds, Pete—the unluckiest man alive—won the lottery.
- I sense something; a presence I've not felt since—

An **en-dash** `–` is used to connect values in a range or that are related. A good rule is to use it when you're expressing a "to" relationship. Examples where an en-dash should be used:

- in years 1939–1945
- pages 31–32 may be relevant
- New York beat Los Angeles 98–95
- Olivia Newton–John

A **hyphen** `-` is used to join words in a compound construction, or separate syllables of a word, like during a line break.

- pro-American
- cruelty-free eggs
- em-dash
- it's pronounced hos-pi-tal-it-tee

Finally, a **minus sign** `−` is distinct from all three of the above.

- 4 − 2 = 2.

If you want to use the correct dash or hyphen in StackExchange comments, just use the appropriate HTML entity: `—` for em-dash, `–` for en-dash, and `−` for the minus sign. The hyphen is, of course, on directly your keyboard.