Consider an arbitrary rotation $R$ in $\mathbb R^3.$
Let the images of the $x$-, $y$-, and $z$-axes under $R$ be labeled
the $x'$-, $y'$-, and $z'$-axes respectively.
There is a rotation by some angle $\alpha$ around the $z$-axis
that takes the $z'$-axis to the $yz$-plane.
Let the $z''$-axis be the image of the $z'$-axis under this rotation.
There is then a rotation by some angle $\beta$ around the $x$-axis
that takes the positive $z''$-axis to the positive $z$-axis.
Let the $x'''$-axis be the image of the $x'$-axis under the previous two rotations.
A rotation by some angle $\gamma$ around the $z$-axis then takes the
positive $x'''$-axis to the positive $x$-axis.
These three rotations, performed in this sequence, take
the $x'$-, $y'$-, and $z'$-axes back to the the $x$-, $y$-, and $z$-axes
in their proper orientation.
To obtain the desired rotation $R$, therefore, simply reverse
these three rotations.
That is, the desired $zxz$-convention Euler angles
are $(\phi, \theta, \psi) = (-\gamma, -\beta, -\alpha)$.
Regarding the dreaded "gimbal lock" problem, consider a rotation $R$ that
consists of a very-small-angle rotation about the $y$-axis.
That is, $R$ takes the positive $y$-axis to itself, but displaces the
$x$- and $z$-axes slightly.
To reverse $R$ via $zxz$ Euler angles, we must first rotate through an
angle $\frac\pi2$ (measured in radians) about the $z$-axis in order to
take points from the $xz$-plane to the $yz$-plane.
We then make a very small rotation about the $x$-axis
followed by another rotation of $\frac\pi2$ about the $z$-axis.
If we want the rotation $R$ to be performed on a reference body mounted on
an axle within a ring-shaped gimbal which in turn is mounted on an axle
within another gimbal which itself is mounted on an axle fixed to a non-rotating frame,
then the $zxz$ Euler angles correspond to a starting position in which
the axle between two two gimbals lies along the $x$-axis and the
other two axles lie along the $z$-axis.
That is, the starting position for this Euler convention
is already in gimbal lock.
It is impossible to produce a continuous rotation about the $y$-axis
by changing the $(\phi, \theta, \psi)$ Euler angles continuously.
This makes this an unsuitable configuration of the gimbals of a spacecraft's
attitude indicator, which must be able to rotate freely within its outer frame.