One types them, using the keyboard and your OS's input method for doing so. E.g. for me on Linux that's a Compose key (where right-control would be), so to type x² I type the sequence x, compose, ^, 2. Windows users are stuck holding alt & memorizing numpad codes, or installing third-party software to support better input methods, but they're masochistic enough to be using Windows so they're used to suffering.
I tend to prefer LaTex in code blocks, since it allows more symbols, but it does require both the reader and the writer to know LaTeX.