We need to analyze the units of each of the magnitudes and solve the operations between them:
[tex]\begin{gathered} m\to kg \\ g\to\frac{m}{s^2} \\ h\to m \\ m\cdot g\cdot h\to kg\cdot\frac{m}{s^2}\cdot m=kg\cdot\frac{m^2}{s^2} \end{gathered}[/tex]A possible unit for potential energy is kg*m^2/s^2.
Also we can use distributive property to replace some of the units by derived units, for example, Newtons:
[tex]undefined[/tex]