For a pendulum,
\[f=\frac{1}{2 \pi} \sqrt{\frac{g}{l}}\]
For a vertically oscillating spring,
\[f=\frac{1}{2 \pi} \sqrt{\frac{k}{m}}\]
Any oscillating system can be made to oscillate at any frequency
\[f\]
resonate by applying an external stimulus \[f_{EXTERNAL}\]
times per second. The frequency \[f_{EXTERNAL}\]
is called the driving frequency. If the driving frequency is equal to the natural frequency, then the amplitude of the oscillation reaches a maximum, and so does the energy of the system. Many systems dissipate this energy by some mechanism - friction or air resistance. If this is not possible the the system may oscillate to destruction. The best example is the Tacoma narrow bridge - nicknamed 'Galloping Gertie', which collapsed when the driving force was applied by wind in 1940.