How does the Sun Generate Energy Today?

The sun generates energy by nuclear fusion. Pressure and gravity force hydrogen atoms together in the center. This fusion results in two hydrogen atoms producing a helium atom and in the process gives off a photon of light.