Step 1: Read the equation as a dimension balance.
In $X = \frac{1}{2}E_r Y Z^2$ the pure number $\frac{1}{2}$ and the dimensionless quantity $E_r$ carry no dimensions, so only $Y$ and $Z$ decide the dimensions on the right.
Step 2: Find the dimensions of $X$.
We are told $X$ is energy, so $[X] = ML^2T^{-2}$.
Step 3: Find the dimensions of $Z$.
$Z$ behaves like $\frac{1}{2}LI^2$, which is the energy stored in an inductor. Energy is energy, so $[Z] = ML^2T^{-2}$.
Step 4: Write the dimension equation.
\[ [X] = [Y]\,[Z]^2 \]
Step 5: Insert the known dimensions.
\[ ML^2T^{-2} = [Y]\,(ML^2T^{-2})^2 = [Y]\,(M^2L^4T^{-4}) \]
Step 6: Solve for $[Y]$ by dividing.
\[ [Y] = \frac{ML^2T^{-2}}{M^2L^4T^{-4}} = M^{-1}L^{-2}T^{2} \]
\[ \boxed{[Y] = M^{-1}L^{-2}T^{2}} \]