The air molecules near a fireplace take the heat energy from the fireplace and become hotter.
We know that the hot air rises up and that space is occupied by cool air. Due to this cyclic process, the physical state of the medium varies.
The refractive indices of hot and cold air are different. Due to the continuous variation of air indices, light rays change their direction. That's why the objects near the fireplace appear to shimmer.
The light rays coming from the fireplace travel through the different mediums of different optical indices and refracted them randomly. So, the near objects fluctuate.
The stars shining in the night sky are due to the same process.