Stretch a tape measure between the back face of the cabinet and the interior side of the cabinet's front face to measure the cabinet's depth. Stretch the tape measure between the interior sides of the cabinet to measure the cabinet's width.
Unroll the mat-type shelf liner on a flat surface. Beginning at the factory-cut end, pull the tape measure across the long dimension of the shelf liner; in other words, the dimension of the liner that will fit the cabinet's width. Use a marker to mark the width of the cabinet's interior on the surface of the liner.
Move the tape measure to the opposite side of the liner and make another mark to represent the width of the cabinet's interior; you now have two, parrallel marks that represent the cabinet's interior width. Lay a straightedge across the marks and draw a marker along the straightedge to create a line that runs through both marks and meets both edges of the liner.
Stretch the tape measure along the straight line that represents the width of the cabinet. Use a marker to create a mark on the line that represents the depth of the cabinet. Move the tape measure to the factory-cut end of the liner. Stretch the tape measure across the end of the liner and use a marker to create a mark that represents the depth the cabinet; this mark should be parallel to the mark on the line that represents the cabinet's width.
Lay a straightedge between the opposite depth marks and run a marker along the straightedge to draw a line between the marks. Cut along the lines with a pair of scissors. Alternatively, use a utility knife to cut along the lines.
Lay the cut shelf liner into the shelf's interior cavity. Adjust the liner until its corners align with the shelf cavity's corners.