You can formalize the process for the block on a spring into a physical model for simple harmonic motion that can be used generally for any oscillating system where the restoring force is directly proportional to the displacement or can be approximated in such a way as to be directly proportional. If this condition is true, the motion will be simple harmonic motion around the equilibrium position. Additionally, the frequency and period of the motion will be independent of the amplitude of the oscillation.
where \(C\) can be any collection of constants. If you can write the equation of motion in this form, then you can immediately determine the angular frequency and period of the oscillation,
This is a powerful model of simple harmonic motion that can predict subsequent motion of many oscillating systems. However, models have their limitations. This model fails if the restoring force is nonlinear, meaning that it is not directly proportional to the displacement.