Light bulb is made up of many part,one of these parts is called the filament.When the electric current(electrons)passes through the filament it heats up.Since electrons increase the kinetic energy of the filament’s atoms which intern increases the temperature. The electrons of the filament atom become excited and move to a higher energy level.When they return back to their initial level they emit photons(Light).
The Earth has its own magnetic field , it acts like there is huge bar magnet buried inside,but this bar magnet is not on the earth rotational axis it is shifted by some angle.The south of the bar magnet is on the magnetic north and the south polarity is on the magnetic north(image).As opposite polarities attract the magnetic needle (north) is attracted to the south polarity in the magnetic north.That’s why the needle always points north.If you want to know “why earth has magnetic field?”go to letter E.