Let me tell about the case of Double-Slit experiment:
Let the wavefunction as
$$\psi(x,t)= A_0\cos\omega\left( t-\frac xv\right) \;.$$
At a point $ P\,,$ at distances $x_1$ and $x_2$ from the first and two slits, the wavefunction can be expressed as:
$$\begin{align}\psi_p(t) &=A_0\cos\omega\left( t-\frac {x_1}v\right)+ A_0\cos\omega\left( t-\frac {x_2}v\right)\\ &= 2A_0\cos\omega t\cos\left[\frac\omega{2v}(x_2-x_1)\right]\end{align}\;.\tag 1 $$
Using $\frac{2\pi v}\omega= \lambda$ in $(1)\,$ we get
$$\psi_p(t)= 2A_0\cos\omega t\cos\left[\frac{\pi}{\lambda}(x_2-x_1)\right]\;.\tag 2$$
Now, phase difference $$\Phi= \frac{2\pi}{\lambda}\,(x_2-x_1)\;;$$
using this in $(2)\,,$ we get
$$\begin{align}\psi_p(t)&= 2A_0\cos\omega t\cos\left(\frac{\Phi}2\right)\\ &= 2y_m\cos\left(\frac\Phi 2\right)\,,\end{align}$$
where
$y_m= A_0\cos\omega t\;.$