Spring force also known as Hooke's law gives the relation between the force acting on a spring and the amount by which the spring is displaced.
It says that force on a spring is directly proportional to the displacement of spring and is directed in the direction opposite to the displacement.
F = -kx
Here, k is the spring constant
The negative sign indicates that the force is a restoring force or in other words it is directed in the opposite direction.
This is because a spring always tends to oppose its stretch or compression and tries to regain its original position.
NOTE: If you have any other conceptual doubt in this section then you may post another query.