The answer is positive for metrisable spaces:
Since any ideal $I$ is determined by a closed set $S\subseteq K$, we have $C(K) / I$ naturally isomorphic to $C(L)$. However, since $K$ is metrisable, the Borsuk-Dugundji theorem yields a contractive linear extension operator $u\colon C(S)\to C(K)$ so that $u(f)|_S = f$ for $f\in C(S)$. This means that the quotient $C(K)/I$ is complemented in $C(K)$ via $Pf = u(f|_S)$. Consequently, $Q = \operatorname{id}-P$ is a projection onto $I$. To see this, take $f\in C(K)$ so that $f$ is zero on $S$. Then $u(f|_S)=0$ as $u$ is linear so it maps zero to zero. Thus $Qf = f - 0 = f$.
The answer is negative for non-metrisable spaces:
To see this, consider $K = \beta N$, the Čech–Stone compactification of the discrete space of natural numbers. The remainder $L = \beta N \setminus N$ is closed but there is no projection onto the associated ideal as otherwise $c_0$ would be complemented in $\ell_\infty$. You may read this post to see why
(This is the so-called Phillips-Sobczyk theorem.)
A stronger no is possible too as there exist spaces $K$ so that only finite-dimensional and finite-codimensional subspaces of $C(K)$ are complemented; see this thread. The first such space was constructed by Piotr Koszmider.