When a gun goes off, the flash and the report of the gun occur at the same moment. If we are very near the gun, we see the flash and hear the noise at the same time. If we are some distance away, however, we see the flash before we hear the report. The length of time before we hear the report will be determined by our distance from the gun.
The sound of the gun, as we know, is carried to our ears by sound waves that pass through the air. Light, too, is composed of waves. Both kinds of waves—those of sound and those of light—take time to travel from one place to another. The speed of sound waves is very much slower than the speed of light waves. Light travels 2,99,792 kilometers in just one second. Sound, on the other hand, travels only about 330 meters in a second. It is easy to see, then, that the light waves will far out-distance the sound waves. We always see the flash of light, no matter how far away we may be, within a tiny fraction of a second after it has happened. But if we are, for instance, about 10 kilometer from the gun when it is fired we will not hear the sound for nearly half a minute.
You have probably noticed, too, when you watched a game of cricket from a distance that you see the bat hit the ball before you hear it. This, too, is because light, by which you see, travels so much faster than sound.