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.