Have a look at the Rotation Matrix Wikipedia article 16 which gives a good overview using these matrices.
There are other approaches, e.g. quaternions, which might be a bit more complicated to get started.