This is really fairly simple. When you walk each step that you take is a certain length. Since your steps will vary in their length, we want to determine your average step length. Then divide the known distance by the number of steps that it took to cover the distance. A high school or college track works great, as that is a distance that is measured accurately.
Many people use their car to measure a distance.
That's okay but not as good as going to a track. Some people use their treadmill. Again, that's okay, but you are assuming that your treadmill is calibrated accurately, and that may not be the case. Here is an example. You walk once around a high school track.