Stars produce energy from nuclear fusion. In the hot, dense interior of the star, hydrogen nuclei (that is to say, protons) smash into other hydrogen nuclei with enough force that they fuse together...
Stars emit light because they are hot - with typical surface temperatures of a few thousand kelvin. And they are hot because they convert energy in their cores, in a process called nuclear fusion.