Most people just use a math library that use quaternions for rotations. If you like a very gentle introduction to them I can recommend the following videos:
General Introduction
Moving to 4×4 Matrices
The Origin of Dot and Cross-Product
More Videos
The full playlist can be found here.
Preview image from Wikipedia: https://en.wikipedia.org/wiki/Quaternion#/media/File:Quaternion_2.svg