For an object near the surface of the earth, the total mechanical energy is
In the absence of friction, this quantity does not change.
To get information about complicated motions, calculate E before and after the events of interest and set them equal to each other.