Before you measure, you will need to remove the screen and open the window. Always measure the opening at the smallest dimension. In other words, measure from the highest point or where the frame intrudes most into the opening. In the image below, you will see 2 typical sliding window frame styles. Whichever frame style you have, always get the 'D' dimension at the narrowest opening as shown.
It is also advisable to measure at the bottom, center and top for the width and at the left, center and right for the height taking the smallest of the measurements. The reason for taking all of the measurements is because the house may have settled and the window may have shifted or sagged. Your replacement window frame dimensions will be 1/2" less than the smallest measurement in each direction. This is called your 'Net Frame Size' or NFS. Always reference your measurements with the width dimension before the height (i.e. 48 1/4" (width) x 36 1/2" (height)).