This is only for Windows. On macOS, you can just use Option+[dash] for en dash and Option+Shift+[dash] for em dash. On Linux, it may differ depending on what IME you use.
|Name||Key or Alt Code||Example|
|Dash or hyphen||dash key on the key board||This is what-a-ma-call-it.|
|En dash||0150||In place of to as in 9–5.|
|Em dash||0151||Break up the sentence—if you know what I mean.|