Heat is a form of energy. There are many different forms of energy, e.g.
if a body moves, it has energy due to its motion. If it moves faster, it
has more energy.

Now, let us imagine that you go to the beach and walk into the ocean
until it reaches your neck. You are standing and waiting for the waves.
Since you are standing still, your energy is zero. As the waves are
coming in to the shore, these waves will sway you back and forth. If
they are strong enough and reach you regularly they may even make you
lose your balance. Your motional state has changed as you started
moving, therefore, you have gained energy from the wave and the wave has
lost energy.

Light is also a wave and in some respects quite similar
to the ocean wave. If it reaches an object, the light waves hit the
atoms in the material, just like ocean waves hit you, and make the atoms
move faster, thus giving them energy. At the same time the lightwaves
lose energy. Since the atoms are now wiggling faster, they have more
energy than beforehand. We may also say that the temperature of the
object increases, because temperature measures how rapidly the atoms
move inside the objects. The swifter the atoms, the higher the
temperature. Interestingly, this process can and does happen in the
opposite direction. Just think about a heating coil on a stove. If it is
really hot it glows with a reddish colour.

There is an important fact we have to notice though. Light does not make
heat out of nothing, but simply transfers a portion of its own energy to
the material it collides with.

I hope this mystery about light is now enlightened and I hope that
you keep asking such interesting questions. Nature is interesting!