
A rotation of coordinate axes is represented via the Euler angles $\:\psi,\theta,\phi \:$ by the matrix,see Figure 01(1).
\begin{equation}
\mathrm{A}\left(\psi,\theta,\phi\right)=
\begin{bmatrix}
\cos\psi \cos\phi - \cos\theta \sin\phi \sin\psi & \cos\psi \sin\phi + \cos\theta \cos\phi \sin\psi & \sin\psi \sin\theta \\
-\sin\psi \cos\phi - \cos\theta \sin\phi \cos\psi & -\sin\psi \sin\phi + \cos\theta \cos\phi \cos\psi & \cos\psi \sin\theta \\
\sin\theta \sin\phi & -\sin\theta \cos\phi & \cos\theta
\end{bmatrix}
\tag{01}
\end{equation}
according to the following scheme
\begin{equation}
xyz \quad \Longrightarrow \quad \xi \eta \zeta \quad \Longrightarrow \quad \xi' \eta' \zeta' \quad \Longrightarrow \quad x'y'z'
\tag{02}
\end{equation}
The 1st rotation $\mathrm{D}$ is around axis $z$ by angle $\phi$, so $\zeta \equiv z$. The 2nd rotation $\mathrm{C}$ is around axis $\xi$ (the "new $x$-axis") by angle $\theta$, so $\xi' \equiv \xi$. The 3rd rotation $\mathrm{B}$ is around axis $\zeta'$ by angle $\psi$, so $z' \equiv \zeta'$.
Also, another representation is via the angle of rotation $\:\Phi \:$ around a direction $\:\mathbf{n}=(n_1,n_2,n_3)\:$, where $\:\mathbf{n}\:$ a unit vector and $\:n_1,n_2,n_3\:$ its $\:x,y,z\:$ components respectively, see Figure 02(2)
\begin{equation}
\mathrm{A}\left(\mathbf{n},\Phi\right)=
\begin{bmatrix}
\cos\Phi+(1-\cos\Phi)n_1^2 & (1-\cos\Phi)n_1n_2+\sin\Phi n_3 & (1-\cos\Phi)n_1n_3-\sin\Phi n_2\\
(1-\cos\Phi)n_2n_1-\sin\Phi n_3 & \cos\Phi+(1-\cos\Phi)n_2^2 &(1-\cos\Phi)n_2n_3+\sin\Phi n_1\\
(1-\cos\Phi)n_3n_1+\sin\Phi n_2 & (1-\cos\Phi)n_3n_2-\sin\Phi n_1 & \cos\Phi+(1-\cos\Phi)n_3^2
\end{bmatrix}
\tag{03}
\end{equation}
(1) "Classical Mechanics" , H.Goldstein-C.Poole-J.Safko, 3rd Edition. Figure 01 is a redrawing of FIGURE 4.46 therein. The matrix $\:\mathrm{A}\left(\psi,\theta,\phi\right)\:$, see equation (01) above, is equation 4.46 therein. This matrix is the product
\begin{equation}
\mathrm{A}=\mathrm{B}\mathrm{C}\mathrm{D}
\tag{foot-01}
\end{equation}
where
\begin{equation}
\mathrm{D}=
\begin{bmatrix}
\cos\phi & \sin\phi & 0 \\
-\sin\phi & \cos\phi & 0 \\
0 & 0 & 1
\end{bmatrix}, \quad
\mathrm{C}=
\begin{bmatrix}
1 & 0 & 0 \\
0 & \cos\theta & \sin\theta \\
0 & - \sin\theta & \cos\theta
\end{bmatrix}, \quad
\mathrm{B}=
\begin{bmatrix}
\cos\psi & \sin\psi & 0 \\
-\sin\psi & \cos\psi & 0 \\
0 & 0 & 1
\end{bmatrix}
\tag{foot-02}
\end{equation}
as in equations (4.43), (4.44) and (4.45) therein.
(2) For the expression (03) of $\:\mathrm{A}\left(\mathbf{n},\Phi\right)\:$ use equation (08) replacing $\:\theta\:$ by $\:-\Phi\:$ in my answer in -Rotation of a vector-
(3) I suggest to read the David Hammen's answer here -Euler angles derivation-
