Matrix multiplication is actually the composition of two linear transformation. While this note only covers calculation, it's a good idea to go see composition of linear transformations for a conceptual understanding as to what it going on.
Transpose, which works for any number of variables
Important
Matrix multiplication is NOT commutative. Order matters. Why? Think about geometric transformations. If we rotate counter-clockwise 90 degrees, and then reflect on the x-axis, that's a different result than reflecting on the x-axis first, then rotating 90 degrees. Visualize this.