Stars blink or twinkle when we observe them (from the surface of the earth) because we are viewing them through different layers of turbulent (swirling) air and temperatures in the Earth's atmosphere (the mass of air surrounding the Earth). This therefore means, the Earth's atmosphere is made up of several “layers” of moving air, each having different temperature and density.
When light from a star (traveling millions of miles) pass through these layers of the Earth’s atmosphere, it is constantly bent (refracted) by each layer of temperature and moving air several times in random directions. This random refraction distorts the image of the star slightly in brightness and position making it look as if it is moving and winking. Thus, this distorted image of the star that we are seeing in the sky causes our eyes to interpret this as a twinkling (blinking) star.
It is also important to note that in outer space stars do not twinkle because there is no atmosphere. So, strictly speaking, stars themselves do not twinkle but appear to do so through the Earth’s atmosphere.