Energy is defined from the work done. for more clarity both work as well as energy is a scalar. I think this is taught in high school at 7 or 8 standard. you better look at textbooks of higher standard.
if you understand work is defined by the dot product of force and displacement.