A caret raises what follows it and an underscore lowers it — a superscript and a subscript. Each takes exactly one item, so x^2 works but 10^23 puts only the 2 up there. Both can sit on the same letter, in either order. Change the 2 to 10 below and watch what happens.
Step 2 of 17 of the LaTeX tutorial. The formula of the step, x_i^2 + 10^23, opens in a live playground you can edit.
Write a LaTeX or mhchem formula and see it drawn as you type, save it as an SVG that opens again, learn the notation step by step, and practise it with graded exercises. The tool needs JavaScript, because the formulas are drawn in your browser.