An old opening is almost never square. Houses settle, framing moves, and a window that was true in 1978 is usually out by a quarter inch or more by now.
The method exists to find the worst case, because the window has to fit that one.
Width: three measurements, take the smallest

Measure from jamb to jamb — the inside faces of the frame, not the trim — at the top, the middle and the bottom of the opening. Write down all three.
Order to the smallest. If the top is 35 3/4″ and the bottom is 36 1/8″, the window is a 35 3/4″ window. Order to the largest and it will not go in; order to the average and it will go in at one end and not the other.
Height: the same, three times
Measure from the sill to the head jamb on the left, in the centre, and on the right. Take the smallest again.
Measure to the highest point of the sill if the sill is sloped, which most are. Measuring to the low front edge gives a height the window cannot actually occupy.
Square: measure both diagonals
Corner to corner, both ways. If the two diagonals differ by more than about 1/4 inch, the opening is out of square enough to matter.
A window is a rectangle. Fitting a rectangle into a parallelogram means shimming, and shimming means gaps that have to be sealed rather than closed. Beyond about 1/2 inch out, an insert stops being reasonable and the opening should be re-framed square during a full frame replacement.
What you are measuring depends on the method
For an insert, measure the existing frame — jamb to jamb and sill to head, as above. The new unit fits inside what is there.
For a full frame replacement, the relevant dimension is the rough opening in the wall framing, which is behind the trim and usually 1/2 to 3/4 inch larger all round than the frame. Most people cannot measure this without removing trim, which is why full-frame quotes are normally measured by the installer rather than the homeowner.
Also measure the frame depth — how deep the opening is from interior wall face to exterior. Some replacement units need a minimum depth, and a 2×4 wall with thick siding can be tighter than it looks.
The mistakes that produce an unusable window
Measuring the trim, not the jamb. The casing is decorative and sits proud of the opening. It can add two inches to a width that will never exist.
Measuring the sash, not the opening. The sash is smaller than the frame it slides in. Order to the sash and the new window is short in both directions.
Rounding up. Round down, to the nearest 1/8 inch. There is no recovery from a window that is too big; a window that is 1/8 inch small gets shimmed and sealed.
Measuring one window and ordering ten. Openings in the same wall, framed on the same day, routinely differ by 1/4 inch or more. Measure every one.
Ignoring the sill slope. The exterior sill pitches to drain. The height that matters is to the highest point, at the back.
Write it down in a fixed order
For every opening: width top, middle, bottom; height left, centre, right; both diagonals; frame depth. Nine numbers plus a note of which room and which wall.
That last part matters more than it sounds. Sorting out a delivery of fourteen windows against a list that says "bedroom 1" and "bedroom 2" when the house has three bedrooms costs an afternoon, and the installer will charge for it.
Have the supplier verify before the order goes in
Almost every supplier will send someone to check measurements before manufacture, and they should — a custom window is not returnable and the liability for a wrong size follows whoever measured.
Take your own measurements anyway. They are what tells you whether the quote you received is for the windows you actually have, and a difference between your numbers and theirs is worth resolving before anything is built.
