The general solutions always have some additive/multiplicative constant, that you must fix in the particular solution.
In order to do so, you need to impose that the particular solution passes through a certain point. In your case, you have
[tex] y(x) = c-4\cos(x) [/tex]
and you want
[tex] y\left(\dfrac{\pi}{2}\right) = 2 [/tex]
Put everything together, and you have
[tex] y\left(\dfrac{\pi}{2}\right) = c-4\cos\left(\dfrac{\pi}{2}\right) = c = 2 [/tex]
Since the cosine is zero in the chosen point. So, we've fixed the value of the constant, and the particular solution is found:
[tex] y(x) = 2-4\cos(x) [/tex]