Consider an orthonormal basis ${\{v_1,v_2\}}$ in the plane. Say any object (e.g. a vector, shape etc.) in the plane is defined with respect to this basis - so if we can rotate the basis vectors through the angle $\theta$ anticlockwise, this will transform any such defined objects in the same way.
Firstly, note that the operation of rotation through $\theta$ about origin $O$ (let us call this operation $T$) is a linear transformation i.e. $T(\vec{v}+\vec{w})=T(\vec{v})+T(\vec{w})$ and $T(\alpha\vec{v})=\alpha T(\vec{v})$ for $\vec{v},\vec{w}\in\mathbb{R^2}, \alpha \in \mathbb{R}$. So we have linear $T:\mathbb{R^2}\rightarrow\mathbb{R^2}$. We then know that $T$ can be represented in matrix form as $(T(v_1),T(v_2))$ where $T(v_i)$, $i\in\{1,2\}$ is the transformed column vector. Then $T((x,y)^t)=xT(v_1)+yT(v_2), (x,y)\in\mathbb{R^2}$.
Any orthonormal basis ${\{v_1,v_2\}}$ corresponds exactly to the radial vector $\vec{e_r}=(cos\phi,sin\phi)$ and tangent vector $\vec{e_\perp}=(-sin\phi,cos\phi)$ of the unit circle with centre $O$ for some particular value of $\phi$. If we want to rotate this orthonormal pair of vectors through an angle of $\theta$, we perform $T(\vec{e_r})$ and $T(\vec{e_\perp})$. Well this is $T(\vec{e_r})=(cos(\phi+\theta),sin(\phi+\theta))$ and $T(\vec{e_\perp})=(-sin(\phi+\theta),cos(\phi+\theta))$. So we get,
$T = \begin{pmatrix}
cos(\theta+\phi) & -sin(\theta+\phi) \\
sin(\theta+\phi) & cos(\theta+\phi)
\end{pmatrix}$
Finally, note that when performing a rotation, we always consider the initial orthonormal basis via which we are working to be fixed at $\theta=0$ since this is our arbitrary way of navigating the plane and we do not consider the frame to be rotated to start with i.e. ${\{v_1,v_2\}}=\{\vec{i},\vec{j}\}$ (the natural/canonical basis), and this gives us our rotation matrix in the plane. Note that if we wish to rotate through $\theta$ in the clockwise direction instead (the non-canonical direction), all we have to do is set $\theta\rightarrow-\theta$ in $T$.
N.B. I have used $T$ to denote the rotation matrix here stemming from the fact that it is a linear transformation - but we usually use $R$ for rotation, $T$ for translation and $S$ for reflection (odd one out, originates from German verb strahlen).