To add and take scalar multiples of quaternions just treat them like 4-dimensional vectors, for example: $$(a_1 +b_1{\bf i} + c_1{\bf j} + d_1{\bf k}) + (a_2 +b_2{\bf i} + c_2{\bf j} + d_2{\bf k})= (a_1+a_2) + (b_1+b_2){\bf i} + (c_1+c_2){\bf j} + (d_1+d_2){\bf k}).$$ Multiplication is defined by the rules of ordinary algebra where $${\bf i^2}={\bf j^2}={\bf k^2} =-1,\quad {\bf i j} = {\bf k} = {\bf -j i}, \quad {\bf j k} = {\bf i} = {\bf -k j},\quad {\rm and}\quad {\bf k i}= {\bf j} = {\bf -i k}.$$ For example $$(2 + 3{\bf i} +4{\bf j} +5{\bf k})(6 + 7{\bf i} + 8{\bf j} + 9{\bf k}) = (12 - 21 - 32 - 45) + (36-40){\bf i} + (35-27){\bf j} + (21 - 28){\bf k} = -86 - 4{\bf i} +8{\bf j} -7 {\bf k}.$$ To read about number systems, where quaternions fit in, why there are no three-dimensional numbers and numbers in higher dimensions, see the NRICH article What Are Numbers?