The equation is $$m{\ddot x} + kx + g\sinθ = 0.$$
I know I have to convert it to the form ${\dot y}_1 = y_2$ and ${\dot y}_2 = \text{something}$.
However I am very inexperienced and very confused on how to find $y_1$ and $y_2$ from this initial equation.
Let's pose $\dot{x} = v$ (i.e. velocity). Then:
$$\begin{cases} m \dot{v} + kx + g\sin\theta = 0\\ \dot{x} = v \end{cases} \Rightarrow \begin{cases} \dot{v} = -\frac{k}{m}x - \frac{g}{m}\sin\theta\\ \dot{x} = v. \end{cases}$$
Maybe, further calculation can be done for $\theta$. But if you don't specify its meaning, then these just are meaningless suppositions.