You write $x = a\cos nt$ and fit the problem to it.
Simple harmonic motion is $\ddot{x} = -n^2(x-c)$ — a family, not a formula. Fix four: the centre $c$ (not always the origin), the amplitude, $n$ from $T = 2\pi/n$, the phase.
Next time: Fix all four before writing the equation.