(disclaimer: I feel like this obsession with dashes is special to native English speakers, which I'm obviously not)
Option-shift-hyphen types an em-dash, option-hyphen an en-dash. Em dashes are used—like this—as something spiritually akin to a parenthetical. En-dashes are used within ranges: the Feb 14–17.
The en dash is also used in things like scores (3–2 Turkey), votes (the bill passed 58–42), or connecting words where the second part is longer than one word (the Australia–New Zealand alliance.) You can remember the latter as, "a hyphen isn't big and strong enough to hold on to more than one word.
If you're on a mac, pressing Option+- is the en dash and Option+Shift+- is the em dash.
However I've only ever used regular dashes. How do you type an em-dash? Is it OS specific? I've taken to using Emacs insert-char with a list of frequently used ones in my scratch buffer. My memory for Unicode is unreliable.
On Linux X11 at least, you can enable the Compose key and then press `<Compose>---` which results in — and `<Compose>--.` which gives you –
On iOS you type it by pressing dash and holding until alternative options come up, same way you type e.g. accented characters.