Dear Student,
Potential Energy is the energy possessed by a body due to change in its shape or due to the position it holds above the surface of the Earth.
Mathematically, it is expressed as:
Potential energy (PE) = Mass (m) x acceleration due to gravity (g) x Height above the Earth (h)
For the given body, if it changes it's height, the change in it's potential energy is given by:
P.E = m x g x (hfinal - hinitial)
P.E = (0.5) x (9.8) x (4-2) ...(In SI system, 500 g = 0.5 kg ; g = 9.8 m/s2)
P.E = 9.8 Joules
Regards