It consists of a coil of wire wound on an iron piece. The coil acts as an electromagnet, as shown in below figure a. An iron strip with a hammer at one end is kept close to the electromagnet. There is a contact screw near the iron strip.
When the iron strip is in contact with the screw, the current flows through the coil which becomes an electromagnet. It then pulls the iron strip. In the process, the hammer at the end of the strip strikes the gong of the bell to produce a sound. However, as soon as the electromagnet pulled the iron strip, the circuit broke.
The current through the coil stopped flowing and the coil no longer behaves as an electromagnet. It no longer attracts the iron strip. The iron strip comes back to its original position and touches the contact screw again.
This completes the circuit. The current flows in the coil and the hammer strikes the gong again. This process is repeated in quick succession. The hammer strikes the gong every time the circuit is completed. This is how the bell rings.
An Electric bell