In several different ways, all of which give almost the same results. The method most easily explained is that used by a French scientist, Fizeau, in 1849. He had a wheel made with 720 teeth round the edge, separated by spaces of the same width as the teeth.
This was mounted in a way that enabled it to be turned steadily at any speed. A beam of light from a lamp was reflected from a mirror through the spaces between the wheel's teeth to another mirror set up about 5 1/3 miles away. The mirror near the wheel had a hole at the center so that an observer looking through it might watch the reflections of light from the distant mirror.
Fizeau found that when the wheel was run up to a certain speed no reflection of light could be seen. This meant that each flash passing through a gap was obstructed by the next tooth after traveling the 10 2/3 miles to the far mirror and back.
So, to find the speed of light, it was only necessary to multiply 10 2/3 miles by the number of times per second (about 18,144) that a gap was replaced by a tooth. The result, as you will find, if you care to work it out, is about 186,000 miles a second.