Lightning usually occurs before thunder. The speed of light is much faster than the speed of sound, so we see lightning before we hear thunder.
According to the National Oceanic and Atmospheric Administration (NOAA), the light we see from a lightning bolt travels at the speed of light, which is about 186,282 miles per second, while the sound of thunder travels at a speed of approximately 1,125 feet per second. Therefore, we typically see lightning first and then hear thunder a few seconds later.
Reference:
National Oceanic and Atmospheric Administration. (2022). Lightning Safety. Retrieved from https://www.weather.gov/safety/lightning-science