The Sun is made of 6 layers. From the inside to outside, these layers are the Core, the Radiative Zone, the Convective Zone, the Photosphere, the Chromosphere, and the Corona.
The core is the “heart” of the Sun. The Hydrogen fusion process that generates heat and light occurs here. The temperature in the core is around 15 million kelvin. The Core is about 1/4th times the radius of the Sun.
The Radiative Zone:
The Radiative zone is made of very dense plasma and cannot move very freely. It allows the transfer of heat and energy from the core to the outer layers by a process called radiative diffusion. The energy in the form of Photons and Electromagnetic radiation tries to escape the radiation zone. These photons keep on bouncing in the radiative zone for thousands of years before being able to escape outside. This layer is 1/2th times the radius of the Sun
The Convection Zone:
The convection zone is also made of less dense Plasma, therefore, it can flow freely. This layer transfers energy from the radiation zone to the Photosphere through convection. The convection in the Sun is very similar to what goes with water being heated in a kettle. The lower plasma layers are heated up and rise towards the surface of the Sun. The Plasma layers reach the surface, cool down, and fall back again.
The Photosphere is the layer visible to us. Visible light leaves this layer and reaches us. This layer is a few hundred kilometers thick. The temperature of the layer is around 5,000 K.
The Chromosphere is the second last layer of the Sun, located between the photosphere and the Corona. The Layer is very less dense and temperature here ranges between 6,000 K to 20,000 K.
The Corona is the atmosphere of the Sun. It is hidden by the brightness of the Sun but is clearly visible during a Total Solar Eclipse. The temperature in this layer is surprisingly high, around a few million Kelvin. The reason for the temperature of the Corona is still uncertain.