I suppose and are matrices.

You need to apply the definition of matrix product. Note that two matrices are equal, precisely when each of the corresponding entries are equal. Let me change the name of the scalar to .

Let be the -entry of and let be the -entry of . Suppose also that is an matrix, and that is an matrix.

Then the -entry of is "the 'th row of times the 'th column of ". So this -entry of is:

,

and so the -entry of is

where the first expression is the entry that follows by applying the definition of the product directly, and where the equality follows from bringing the scalar into each term of the sum.

Consider then the product . We need to check that the -entry of this product is same expression as for . But is the matrix, where the -entry is . The product has as its -entry the 'th row of this matrix multiplied by the 'th column of , so

But this is exactly the same expression as above.

Similarly you may show that A(cB) has the correct -entries.