It's been a while since I've had to explain the process of solving second order ODE's, so if anyone finds a mistake in this please do let me know
In order to solve this differential equation you would have to learn how to solve Second-Order Differential equations in general. The equation you have provided is known as a Second-Order Inhomogenous Linear Ordinary Differential Equation with Constant Coefficients.
These are of the form (Note that $q$ in this equation ONLY is not the same as your charge function q):
$$y''+py'+qy=r(x)$$
Second-Order: Involves the second derivative of $y$
Linear: It is of the form $p_0(x)\frac{d^ny}{dy^n}+p_1(x)\frac{d^{n-1}y}{dy^{n-1}}+p_2(x)\frac{d^{n-2}y}{dx^{n-2}}+...+p_ny(x)=r(x)$
Inhomogenous: $r(x) \neq 0$
Constant Coefficients: $p$ and $q$ are constants.
Your equation in this form is:
$$-Lq''+Rq'+\frac{q}{C}=-V\Rightarrow q''-\frac{R}{L}q'-\frac{1}{LC}q=\frac{V}{L}$$
To solve this we must do the proceed with the following steps:
Step 1: Finding the complementary solution
We start by solving the equivalent homogenous problem $y''+py'+qy=0$
Setting $V=0$
$$ q''-\frac{R}{L}q'-\frac{1}{LC}q=0$$
Now we need to find what is known as an auxillary equation. We consider that $q$ is of the form $e^{mt}$.
$$q=e^{mt},\,q'=me^{mt},q''=m^2e^{mt}$$
If we plug these in and rearrange, we get:
$$e^{mt}(m^2-\frac{R}{L}m-\frac{1}{LC})=0$$
Since $e^{mt}\neq0$, then $(m^2-\frac{R}{L}m-\frac{1}{LC})=0$
This is a quadratic equation with solutions:
$$m_{1,2}=\frac{\frac{R}{L}\pm\sqrt{\frac{R^2}{L^2}-\frac{4}{LC}}}{2}\Rightarrow m_1=\frac{\frac{R}{L}+\sqrt{\frac{R^2}{L^2}-\frac{4}{LC}}}{2},m_2=\frac{\frac{R}{L}-\sqrt{\frac{R^2}{L^2}-\frac{4}{LC}}}{2}$$
The discriminant of the roots $\Delta = \frac{R^2}{L^2}-\frac{4}{LC}$ causes three different cases to arise:
Case 1:$\Delta>0$, which tells us we have two distinct real roots, and in this case we get two linearly independent solutions:
$$q_1=e^{m_1t},q_2=e^{m_2t}$$
which gives us the complementary solution:
$$q_c(t)=C_1e^{m_1t}+C_2e^{m_2t}$$
Case 2:$\Delta=0$, which tells us we have a double repeated root ($m_1=m_2=m$), and in this case we get two linearly independent solutions:
$$q_1=e^{mt},q_2=te^{mt}$$
which gives us the complementary solution:
$$q_c(t)=C_1e^{mt}+C_2te^{mt}$$
Case 3:$\Delta<0$, which tells us we have a two distinct complex roots and in this case we get two linearly independent solutions:
$$q_1=e^{(a+ib)t}=e^{at}(\cos bt+i\sin bt), q_2 = e^{(a-ib)t}=e^{at}(\cos bt-i\sin bt)$$
which gives us the complementary solution:
$$q_c(t)=e^{at}[C_1(\cos bt+ i\sin bt)+C_2(\cos bt - i \sin bt)]$$
Step 2: We find the particular solution (or particular integral), and this usually is a trial-and-error approach where your decision depends on the form that $r(x)$ comes in. In our case $r(x)=V$, which is just a constant function of $t$. So we will make the guess that $q_p=A$, another constant function of $t$.
Plugging this in we get:
$$-\frac{A}{LC}=\frac{V}{L}\Rightarrow A=-CV$$
And if my knowledge of Electrical Physics is correct, I believe that $CV=Q$
Therefore,
$$q_p=-CV=-Q$$
Step 3: Now that we have our complementary and particular solutions, all we need to do is add them together to get our general solution. Hence for cases $1$ and $3$,
$$q(t)=q_c+q_p\Rightarrow q(t)=C_1e^{m_1t}+C_2e^{m_2t}-Q$$
or for case $2$,
$$q(t)=q_c+q_p\Rightarrow q(t)=C_1e^{mt}+C_2te^{mt}-Q$$
The constants $C_1,C_2$ and $Q$ can only be determined by knowing values of $q(t)$ at different times $t$, which brings two new problems in differential equations known as Initial-Value Problems and Boundary-Value Problems.
I believe in your specific equation the electrical circuit is undamped, which means $\Delta<0$ and that is how the "exponentially decreasing sine wave function arises".
Hope this gives you some insight on how to solve Second-Order ODE's.