And that motion is mathematically identical to the motion of something bouncing up and down on a spring with a linear restoring force - also sine waves over time.
If you wanna know how much of a particular sine wave is in a signal, just multiply the signal by the sine wave at each point and then add up the area under the curve.
As a simple example, say our signal is just a sine wave with a certain frequency but pretend we don't know that and we're trying to figure out which sine waves add to make it up.