Hey! I empathize with you, as I just started the energy unit in physics as well!
Alright, lets list what we know, and which equation(s) we need.
PE = Gravitational Potential Energy

m = mass
g = gravity (9.8 m/s^2)
h = height
Guess what?
We need to find the height!
Lets make this more organized:
Known:
m = 40 kg
PE = 14000
g = 9.8 m/s^2
Unknown:
h = ?
================================
Now, if we take a look at the equation PEg = mgh, you will see that we have everything besides the height! So lets solve for the height by substituting in for the variables we know:
14000 J = 40 kg * (9.8 m/s^2) * h
40 * 9.8 = 392
14000 J = 392 * h
14000/392 = h
35.71 m = h
There we go! If you simply list what you know and don't know, you will find the equation you need to solve the problem.
Have a great day and good luck!