The mass of a star was at some point a nebula, which collapsed into the star.
That collapse reduced the gravitational potential energy of the mass of that nebula, which through accelleration, friction, and pressure, was turned into heat energy.
That heated mass will emit black-body emissions, and so the gravitational energy is now being radiated as light.
Yes, heat through pressure and friction as the matter tries to collapse under gravity. Not quite enough heat and pressure to trigger a sustained fusion reaction.
One interesting thing is that this star was detected at visual wavelengths, not infrared. While not undergoing fusion, it’s hot enough to glow blue-white.
That collapse reduced the gravitational potential energy of the mass of that nebula, which through accelleration, friction, and pressure, was turned into heat energy.
That heated mass will emit black-body emissions, and so the gravitational energy is now being radiated as light.