Elastic potential energy of a body can be achieved by
compressing or stretching the body
Some work is done in compressing, bending, stretching and twisting the body. This work gets stored in the deformed body in the form of elastic potential energy. When this deformed body is released, it comes back in its original shape and size and the potential energy is given out in some form or other