The twinkling of stars at night is due to
Continuous change in the refractive index of air layers
The refractive index of air layers keeps on changing due to wind and convection currents thereby changing the apparent position of the stars and hence they appear to be twinkling.