a) To begin with we will calculate the gravitational potential energy at height, h. This is the result of the mass, m, being lifted through earth's gravitational pull, (approximated as g = 9.81 m/s at the earth's surface) by a height, h, and is simply given as multiple of these three quantities.
Ep = m*g*h

We know that the kinetic energy of an object is strongly related to how fast the mass is moving, and that the faster it is moving the more energy it has. It is actually dependent on the velocity (speed), v, squared and is given by:
Ek = 0.5*m*(v^2)

b) The principle of Energy conservation states that in any situation, anywhere in the universe, energy can not be created or destroyed, only transferred from one form to another... So, from this we must consider the energy of the pendulum in each situation and how it transfers between each stage:

Just before it is released from the height, h, we know it has a potential energy of Ep = m*g*h. As it is being held it must be stationary and have a speed of v= 0 and therefore kinetic energy of Ek = 0.

When it reaches the bottom it's swing, the height is h = 0 and so Ep = 0. Although it is possible that the whole system is being held at higher height above the earth, we know that the pendulum cannot get any lower than the bottom of its swing as it is attached to a string. This means that it will never be able to achieve a lower potential energy, and so for simplicity we might as well take this as the zero level, as we are only really interested in the change of energy in the system anyway.

As we calculated before, at this point the kinetic energy is Ek = 0.5*m*(v^2).

Finally, because of the principle of energy conservation, we know that the energy at one time (the pendulum being held at height h) must equal the energy at another time (the pendulum at the bottom of its swing) as energy can't have just disappeared, therefore:

Total energy before = Ek + Ep = 0 + h*g*m
is EQUAL to
Total energy later = Ek + Ep = 0.5*m*(v^2)