In order to input Japanese characters (including hiragana, katakana, and kanji), you’ll first have to enable Japanese input.
For iPhone, go to Settings > General > Keyboard > Keyboards > Add New Keyboard.
For Android, go to Settings > Language and input > Keyboard > Add input languages.
For Windows, see here: Type in Chinese, Japanese, and other character‑based languages
For Mac, see here: How to Type Japanese Characters on Your Mac
For Windows and Mac, you can also use Google’s input method (warning - lots of Japanese on this page): 思いどおりの日本語入力