Helpo de LibreOffice 7.5
In the cell, select the character that you want to put in superscript or subscript.
If, for example, you want to write H20 with a subscript 2, select the 2 in the cell (not in the input line).
Open the context menu for the selected character and choose Character. You will see the Character dialog.
Click the Font Position tab.
Select the Subscript option and click OK.