How $a+bi$ becomes $\left(\matrix{a & -b\\b & a}\right)$? How do you change something into a matrix? E.g) 

How does $2+3i$ become $\left(\matrix{2 & -3\\3 & 2}\right)$

Is  there a specific rule for changing an input into a matrix that has to be learned? Or how is it done?
Thank you.

It corresponds to one way to construct the field of complex numbers:
$$\mathbf C=\biggl\{\begin{pmatrix}a&-b\\b&a\end{pmatrix}\bigg\vert a,b\in\mathbf R\biggr\}=\biggl\{a\begin{pmatrix}1&0\\0&1\end{pmatrix}+b\begin{pmatrix}0&-1\\1&0\end{pmatrix}\bigg\vert a,b\in\mathbf R\biggr\}$$
This is a commutative subring of $\mathcal M_2(\mathbf R)$.
In this construction, we identify the number $1$ with $I$, the unit $2\times 2$ matrix, a real number $a$ with the diagonal matrix $\begin{pmatrix}a&0\\0&a\end{pmatrix}$, and the imaginary number $\mathrm i$ with the matrix $J=\begin{pmatrix}0&-1\\1&0\end{pmatrix}$, which is justified by the fact that $J^2=-I$.
