First step is taking a side profile measurement.
Using a standard measuring tape or ruler (if the length will work) place the zero-mark at the receiver end of the rail.
Pull the tape down the rail keeping the tape parallel to the top rail and trying to not cover any openings in the rail ( mlok, keymod, lightning holes or any other openings).
Once the measuring tape is positioned correctly, focus in on an area that you will want the cut and ensure it will not interfere with any openings and is at least .75 or 3/4 inches shorter than the length of the barrel you wish to use.