This follows from the uniqueness theorem for solutions of ordinary differential equations, which states that for a homogeneous linear ordinary differential equation of order $n$, there are at most $n$ linearly independent solutions.
The upshot of that is that if you have a second-order ODE (like, say, the one for the harmonic oscillator) and you can construct, through whatever means you can come up with, two linearly-independent solutions, then you're guaranteed that any solution of the equation will be a linear combination of your two solutions.
Thus, it doesn't matter at all how it is that you come to the proposal of $\sin(\omega t)$ and $\cos(\omega t)$ as prospective solutions: all you need to do is
- verify that they are solutions, i.e. just plug them into the derivatives and see if the result is identically zero; and
- check that they're linearly independent.
Once you do that, the details of how you built your solutions become completely irrelevant. Because of this, I (and many others) generally refer to this as the Method of Divine Inspiration: I can just tell you that the solution came to me in a dream, handed over by a flying mass of spaghetti, and $-$ no matter how contrived or elaborate the solution looks $-$ if it passes the two criteria above, the fact that it is the solution is bulletproof, and no further explanation of how it was built is required.
If this framework is unclear or unfamiliar, then you should sit down with an introductory textbook on differential equations. There's a substantial bit of background that makes this sort of thing clearer, and which simply doesn't fit within this site's format.
The mathematical representation of the particle in simple harmonic motion model is based on three separate equations, not only one (which you have pointed out): $$F = -kx$$ $$\frac{d^2x}{dt^2} = -\omega^2x$$ $$x(t) = A\text{cos}(\omega t+\phi)$$
Hence if you are analyzing a mechanical situation and you find that it is of the form of any of these equations, it's motion can be modelled as simple harmonic.
In the case of the torsional pendulum, it's position can be described as: $$\tau = I\frac{d^2\theta}{dt^2} = -\kappa\theta$$ which is analogous to the second equation and the situation is a mechanical one. Hence, as long as the elastic limits of the wire isn't exceeded, this motion can be modelled as simple harmonic.
An LC circuit cannot be strictly modelled as simple harmonic, because it is not a mechanical one. However, the oscillations of the value of electric and magnetic field in the capacitor and inductor very closely resemble a spring-block system. This fact is used to obtain the equation: $$q = Q_{\text{max}} \text{cos}(\omega t + \phi)$$
Also note
'Force' is inversely proportional to 'Distance'
The term $x$ here refers to position, relative to the equilibrium position, and not strictly the distance.
Hope this helps.
Best Answer
In the role of the "restoring force" there is the cartesian component of the centripetal force. The whole force causes the body to move in circle, the component causes the cartesian coordinate to change as sine function of time.