They Took Rock Samples And Analyzed Them

There are no samples of ancient ocean water lying around, but there are ancient rocks that used to be on the ocean floor. The research team collected rock samples from the outcrop of exposed ocean crust to analyze them.
Specifically, they looked for the oxygen isotopes Oxygen-16 and Oxygen-18. An isotope is an atom that has the same number of protons as other atoms of that particular element but a different number of neutrons. The researchers used a methodology that would compare the isotopic content of the primeval ocean to the ocean that we have today.