Also remember the restoring force is equal to kx.
So ma=-kx as the restoring force acts in opposite direction to displacement.
So a=-(kx)/m and a=-w^2x we can equate these to eliminate x and find expressions for the frequency and time period of an oscillating mass spring system.