The columns of the matrix tell you where it sends the standard basis vectors. For instance if I am interested in the third column then I need to determine what the action of our linear operator is on the column vector ,
This vector can be written as a linear combination of the vectors used to define the linear operator,
Multiplying both sides by our linear operator M we get,
Note that we know what M does to the vectors on the right so we can just substitute those values in and add,
The resulting vector is the third column of our matrix,
A similar process will yield the other collumns.