Order of operations
Work in this order: parentheses, then exponents, then multiplication and division together from left to right, then addition and subtraction together from left to right. (PEMDAS, but M and D are a tie, and so are A and S.)
The usual trap: 12 ÷ 2 × 3 is 18 (left to right), not 2.
AFOQT questions on this: Order of operations · Evaluating expressions