Reference : My answer there Need help understanding an equation of motion for a pendulum.
$=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!$
A choice for the general solution is the sinusoidal
\begin{equation}
x_{\bf s}\left(t\right)\boldsymbol{=}\alpha_{\bf s}\sin \left(\omega t\boldsymbol{+}\phi_{\bf s}\right) \qquad \alpha_{\bf s},\phi_{\bf s} \in \mathbb{R}
\tag{A-01}\label{A-01}
\end{equation}
The real constants $\alpha_{\bf s},\phi_{\bf s}$ are determined from the initial conditions of the harmonic oscillator.
This general expression is essentially identical to
\begin{equation}
x(t)\boldsymbol{=}A\cos\omega t\boldsymbol{+}B\sin\omega t \qquad A,B\in \mathbb{R}
\tag{A-02}\label{A-02}
\end{equation}
given by @G.Smith in his answer if we relate the two pairs of constants $\left(\alpha,\phi\right)$ and $\left(A,B\right)$ by
\begin{equation}
\alpha_{\bf s}\boldsymbol{=}\sqrt{A^2\boldsymbol{+}B^2} \qquad\quad \phi_{\bf s}\boldsymbol{=}\arcsin\dfrac{A}{\sqrt{A^2\boldsymbol{+}B^2}}\boldsymbol{=}\arccos\dfrac{B}{\sqrt{A^2\boldsymbol{+}B^2}}
\tag{A-03}\label{A-03}
\end{equation}
Equally well we could choice for the general solution the co-sinusoidal
\begin{equation}
x_{\bf c}\left(t\right)\boldsymbol{=}\alpha_{\bf c}\cos \left(\omega t\boldsymbol{+}\phi_{\bf c}\right) \qquad \alpha_{\bf c},\phi_{\bf c} \in \mathbb{R}
\tag{A-04}\label{A-04}
\end{equation}
The real constants $\alpha_{\bf c},\phi_{\bf c}$ are also determined from the initial conditions of the harmonic oscillator while their relations to the pair of constants $\left(A,B\right)$ of equation \eqref{A-02} are given by
\begin{equation}
\alpha_{\bf c}\boldsymbol{=}\sqrt{A^2\boldsymbol{+}B^2} \qquad\quad \phi_{\bf c}\boldsymbol{=}\arccos\dfrac{A}{\sqrt{A^2\boldsymbol{+}B^2}}\boldsymbol{=}\arcsin\dfrac{\boldsymbol{-}B}{\sqrt{A^2\boldsymbol{+}B^2}}
\tag{A-05}\label{A-05}
\end{equation}
$=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!$
An interpretation of the two alternative equivalent representations \eqref{A-01} and \eqref{A-04} of a simple harmonic oscillation is shown in the Figure below. Here a particle $\:\rm p\:$ executes a simple linear harmonic oscillation between the points $\boldsymbol{-}R$ and $\boldsymbol{+}R$ on the $x\boldsymbol{-}$axis. Note that this motion could be considered as the projection on the $x\boldsymbol{-}$axis of a plane uniform circular motion. If without loss of generality we have $\omega\boldsymbol{>}0$ then the top circle represents an anticlockwise uniform circular motion corresponding to the co-sinusoidal choice \eqref{A-04} while the bottom circle represents a clockwise uniform circular motion corresponding to the sinusoidal choice \eqref{A-01}. The Figure shows the condition of the systems at time moment $t\boldsymbol{=}0$.