To add and take scalar multiples of quaternions just treat them like 4-dimensional vectors, for example:
( a1 + b1 i+ c1 j+ d1 k)+( a2 + b2 i+ c2 j+ d2 k)=( a1 + a2 )+( b1 + b2 )i+( c1 + c2 )j+( d1 + d2 )k).

Multiplication is defined by the rules of ordinary algebra where
i2 = j2 = k2 =-1,   ij=k=-ji,   jk=i=-kj,   and   ki=j=-ik.

For example
(2+3i+4j+5k)(6+7i+8j+9k)=(12-21-32-45)+(36-40)i+(35-27)j+(21-28)k=-86-4i+8j-7k.

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?