The following problem is taken from Burris and Sankappanavar's A Course in Universal Algebra (11, pg 42).
Suppose $L$ is a distributive lattice and $a,b,c,d\in L$. Then $\langle a, b\rangle\in\Theta(c,d)$ if and only if $c\wedge d\wedge a = c\wedge d \wedge b$ and $c\vee d\vee a = c\vee d \vee b$.
Here, $\Theta(c,d)$ denotes the smallest congruence on $L$ that contains $(c,d)$, i.e., the principal congruence on $L$ generated by $(c,d)$.
Proving sufficiency is straightforward. However, I am not sure about where to get started on the necessary part. Any help is appreciated.
A possible way to tackle this problem (I did it that way years ago when I was studying that book, but there might be a more straightforward one...) is to consider $$\Phi = \{ \langle a,b\rangle \in L^2 : a\wedge c\wedge d = b\wedge c\wedge d \;\text{and}\; a\vee c\vee d = b\vee c\vee d\}.$$ Prove that $\Phi$ is a congruence (it's immediate that it's an equivalence relation).
Next, notice that clearly $\langle c, d \rangle \in \Phi$, whence $\Theta(c,d) \subseteq \Phi$, and then prove the reverse equality.
To prove this last equality, what I did was to show that if $\theta$ is a congruence such that $c\equiv_{\theta}d$ then from $a\equiv_{\Phi}b$ we can conclude that $a\equiv_{\theta}b$.
If you find something unclear in this reasoning, or if you still can't complete the proof, I can elaborate on this later on.