Different masses m are hung from the spring and the corresponding deflections δ of the spring from its unstretched configuration are measured.
From physics, we know that F = kδ and here F = mg.
Thus, we can find k from the relationship k = mg/δ.
Here, however, we are going to find k by plotting the experimental data, fitting the best straight-line (we know that the relationship between δ and F is linear) through the data, and then measuring the slope of the best-fit line.