Suppose we have an $m \times n$ matrix $A$ and $n$-vector $\mathbf b$
There are two equivalent ways to do it:
See $A$ as $m$ vectors along rows:
$A = \begin{bmatrix} — \mathbf a_1 \,— \\ — \mathbf a_2 \,— \\
... \\
— \mathbf a_m \,— \end{bmatrix}$
And then multiply (using Dot Product) each row $(\mathbf a_i)^T$ with the vector $\bf x$:
— (\mathbf a_1)^T \mathbf b \,— \\ — (\mathbf a_2)^T \mathbf b \,— \\
... \\
— (\mathbf a_m)^T \mathbf b \,— \end{bmatrix}$
Another way to see $A$ is as $n$ vectors along columns:
$A = \begin{bmatrix} \mathop{a_1}\limits_|^| \ \mathop{a_2}\limits_|^| \ \cdots \ \mathop{a_n}\limits_|^| \end{bmatrix}$
When we multiply $A$ on a vector $\mathbf b$, it produces a Linear Combination of these column vectors:
$A \mathbf b = \begin{bmatrix} \mathop{a_1}\limits_|^| \ \mathop{a_2}\limits_|^| \ \cdots \ \mathop{a_n}\limits_|^| \end{bmatrix} \mathbf b =
b_1 \begin{bmatrix} \mathop{a_1}\limits_|^| \end{bmatrix}
+ b_2 \begin{bmatrix} \mathop{a_2}\limits_|^| \end{bmatrix} + \cdots + \ b_n \begin{bmatrix} \mathop{a_n}\limits_|^| \end{bmatrix}$
$\begin{bmatrix} 2 & 5\\ 1 & 3 \end{bmatrix} \cdot \begin{bmatrix} 1 \\ 2 \end{bmatrix} $
Row at a time:
1 \\ 2 \end{bmatrix} = 2 \cdot 1 + 5 \cdot 2 = 12$
1 \\ 2 \end{bmatrix} = 1 \cdot 1 + 3 \cdot 2 = 7$
2 & 5\\ 1 & 3 \end{bmatrix} \cdot \begin{bmatrix} 1 \\ 2 \end{bmatrix} = \begin{bmatrix} 12 \\ 7 \end{bmatrix}$
Column at a time
2 \\ 1 \end{bmatrix} + 2 \begin{bmatrix} 5 \\ 3 \end{bmatrix} = \begin{bmatrix} 12 \\ 7 \end{bmatrix}$
A vector may be on the left of the matrix as well