The formula is radius devided by distance times correction.
Measure you sight radius from face of front sight to face of rear, that is "radius". Divide that by the "distance" to the target in inches and multiply by the desired correction. If we say your sight radius is 30" and you're shooting at 25 yards (900 inches) and you want to come up 6" then it would be 30 divided by 900 equals .0333, times 6 equals .1999" to file off front sight.
Probably most people file their sights at the range, cut and try, cut and try, but I prefer to use the formula and file my sights in the shop with the barrel in a vise where I can keep the cut nice and square.