Actually, stars don’t twinkle at all. They only appear to twinkle. This is why it happens. The lights of the stars reach us by passing through the astomosphere of the Earth, which is made up of many layers of gases. These gases have different temperatures, pressures and several pockets of hot and cold air. When light passes through these gases, it gets slightly affected by these factors and bends a little from the ground, it appears that the stars are twinkling.
Oh, wait! It that way a coin on the floor of the swimming pool appears to be twincling and dancing? It seems the light just can’t stay in a straight line because of these distraction! Just like Robbu in school!