But Einstein discovered that light is also made of particles, called "photons".
And the energy of a photon is just the rate at which its wave wiggles — its "frequency" —
times a number called Planck's constant:
E = h ν
Here E is energy, h is Planck's constant, and ν is frequency (wiggles per second).