AC power comes from an electrical generator, which is a set of stationary coils (the stator) around a rotating magnetic field (the rotor). This configuration produces a sinewave output. We use a sine...
A square wave can be changed into a sine wave by either active filtering [recomended] or passive filtering.
Filter the square wave with a low-pass filter sharp enough to remove all frequencies above the frequency of the square wave.
The sine wave, with its repeating pattern, can represent a single frequency with no harmonics.
An astable multivibrator is an example of a square wave generator circuit.