to get
$$\frac{f_i^{n+1}}{f_i^n} = 1+2d(\cos(k_{\eta}\Delta x)-1) = G,\,\,\mbox{say}.$$
This will be stable for $|G|\le 1$. This implies
$$-1\le 1 + \underbrace{2d}_{>0}(\underbrace{\cos(k_{\eta}\Delta x)}_{-1\,\mbox{to}\,1}-1) \le 1.$$
The upper bound in this equation (right-most inequality) is always satisfied.
For the lower bound, rearranging, we have
$$ -2\le2d(\cos(k_{\eta}\Delta x)-1),$$
or
$$d\le\frac{1}{1-\cos(k_{\eta}\Delta x)}.$$
We want the minimum of the right hand side (RHS), since $d$ has to be less than or equal to it. The RHS is minimized for
$$\max(1-\underbrace{\cos(k_{\eta}\Delta x)}_{-1\,\mbox{to}\,1}),$$
The maximum here is $2$.
Hence,
$$d\le\frac{1}{2}.$$
This method applies to other PDEs too.
If the PDE is nonlinear, then linearize it (e.g., Taylor Series), then apply the analysis.
If the coefficients are not constant, then pretend they are and apply locally.
Take the most conservative $\Delta t$.
For example, for $\alpha\Delta t/\Delta x^2\le 1/2$, we have $\Delta t\le (1/2)(\Delta x^2/\alpha)$. Evaluate at $\min(\Delta x^2/\alpha)_i$ on the domain.