Light (the speed of light) travels at 299,792 km/sec and the speed of sound travels at 0.34029 km/sec. Once you are in a safe location, such as in a building or car for example, you can then make a close estimate of the distance of the lightning strike/storm. After the flash of lightning, begin counting off the seconds until the thunder is heard. Divide the seconds by three to arrive at the approximate distance in km.
Distance in kilometers example: 15 seconds/3 = 5 km away.
Distance in miles example: 15 seconds/5 = 3 miles away.
Remember to stay in a safe location for 30 minutes after the last rumble of thunder is heard.