F=-kx, where k is the spring constant and x is the displacement of the spring from its unstrained length. The minus sign indicates that the restoring force always points in a direction opposite to the displacement of the spring from its unstrained length (newton’s law of action & reaction).