Dear student,
Stars twinkle because our atmosphere is constantly moving around or is turbulent. The light travelling from the stars gets bent in different direction making them twinkle. It is quite similar to the effect when viewing the reflection of the moon on a lake's surface when its (lake) moving.
Regards