Why does the solution choose those highlighted in green. Don't you normally have to pick the more general $\displaystyle\eta=\hat\eta (e^{ik(x-ct)}+$complex conjugate$)$
and then consider $\hat\eta e^{ik(x-ct)}$ etc. alone?
Consider deep water gravity waves but assume now that there are two fluids separated by the interface at $y=\eta(x,t)$ and suppose that the upper fluid extends to $y\to\infty$. Let the fluid in the lower layer have density $\rho_1$ and let the density of the upper fluid be $\rho_2\lt\rho_1$. Show that the phase speed $c$ of waves on the interface with wave number $k$ will be given by $$c^2=\frac{g}{|k|}\left[\frac{\rho_1-\rho_2}{\rho_1+\rho_2}\right].$$

The write-up skips some steps for the complete solution of this problem.
In general, you can start by assuming a solution of the form:
$$\phi_1 = C_1e^{ikx}e^{ily}e^{-i\omega t},\\\phi_2 = C_2e^{ikx}e^{ily}e^{-i\omega t}.$$
Ultimately you will choose only the real part of these functions as the solution -- after the (complex) constants have been determined by boundary conditions.
The velocity potentials must satisfy Laplace's equation. You will find that $k^2+l^2 = 0$ which cannot be satisfied if both $k$ and $l$ are real. In order for the velocity to go to zero at large distances from the interface, $k$ must be real and the solution now has the form:
$$\phi_1 = C_1e^{ky}e^{ikx}E^{-i\omega t},\\\phi_2 = C_2e^{-ky}e^{ikx}E^{-i\omega t}.$$
Also you can assume, in general, that
$$\eta = Ce^{ikx}e^{-i\omega t},$$
but you will not need this directly.
You can eliminate $\eta$ from the boundary conditions at $y=0$. Using
$$\frac{\partial \eta}{\partial t} = \frac{\partial \phi_1}{\partial y}=\frac{\partial \phi_1}{\partial y},\\ \rho_1 \frac{\partial \phi_1}{\partial t} + \rho_1 g \eta= \rho_2 \frac{\partial \phi_2}{\partial t} + \rho_2 g \eta,$$
and differentiating the second condition with respect to $t$, we get
$$ \rho_1 \frac{\partial^2 \phi_1}{\partial t^2} + \rho_1 g \frac{\partial \phi_1}{\partial y}= \rho_2 \frac{\partial^2 \phi_2}{\partial t^2} + \rho_2 g \frac{\partial \phi_2}{\partial y}.$$
After solving for $\phi_1$ and $\phi_2$ and taking the real part, you will find that only $\sin(kx-\omega t)$ remains.
Then use the following condition to solve for $\eta$:
$$\frac{\partial \eta}{\partial t} = \frac{\partial \phi_1}{\partial y}$$
You will find it has the form $\cos(kx-\omega t).$