One typically computes functional derivatives in the following manner:
- Substitute $u+h$ for $u$.
- Simplify and rearrange to obtain only terms linear in $h$.
- Applying integration by parts to this linear term obtain something of the form $\int g(u)h~\mathrm{d}x$.
- Set equal to zero for all $h$ to obtain $g(u) = 0$, the condition for an extrema of the functional.
If done correctly, $dFh := \int g(y)h~\mathrm{d}x$ will be the action of the derivative of $F$ on $h$ and $g(u)$ will be the gradient of $F$, which can then be set equal to zero to determine extrema. In this notation, $g(u) = 0$ is the Euler-Lagrange equation, which you may be familiar with.
To perform this procedure on this problem, we begin by assuming everything lies in $L^2(\Omega)$ for some spatial domain $\Omega$ with smooth boundary and write everthing as an integral.
$$F(u) = \frac{1}{2}\int_\Omega (u-f)^2 + (D - \nabla u)\cdot(D-\nabla u)~\mathrm{d}x.$$ Notice that I have rewritten your derivative terms as a dot product where $D = (d_x,d_y)$. This will be important to apply integration by parts on the general domain $\Omega)$.
We now substitute the perturbed state $u+h$ and expand all the squares to obtain
$$F(u+h) = F(u) + \int_\Omega (u-f)h - (D-\nabla u)\cdot\nabla h~\mathrm{d}x + \mathcal{O}(h^2).$$ We have isolated the linear part of the perturbation, which can be thought of as the directional derivative of $F$ at $u$ in the direction of $h$. From this, we can manipulate to obtain the gradient of $F$. To do this, we will use the higher-dimensional version of integration by parts (Green's first identity), which states that
$$\int_\Omega U\cdot\nabla v~\mathrm{d}x = -\int_\Omega \nabla\cdot Uv~\mathrm{d}x + \int_{\partial\Omega} vU\cdot\hat{n} ~\mathrm{d}S.$$
Notice that this has the same structure as standard $1$-D integration by parts: move the derivative from one function to the other, negate, and add boundary terms. We can use this to obtain our Euler-Lagrange equation.
$$dFh = \int_\Omega (u-f)h - (D-\nabla u)\cdot\nabla h~\mathrm{d}x = \int_\Omega (u-f + \nabla\cdot(D-\nabla u))h~\mathrm{d}x - \int_{\partial\Omega}h (D - \nabla u)\cdot\hat{n}~\mathrm{d}S.$$
We can now set this equal to zero for all $h$ to obtain the conditions for $u$ to be an extrema of $F$. For this quantity to be zero for all $h$, we must have the factors in the integrand multiplying $h$ be identically zero. That is, we have
$$\nabla\cdot(D - \nabla u) + u - f = 0,~x\in\Omega \\
\nabla u\cdot\hat{n} = D\cdot\hat{n},~x\in\partial\Omega.$$
Notice that by doing this analysis, we obtain the boundary conditions for an extremal $u$ as well as a PDE governing its behavior inside $\Omega$. Without doing this variational analysis, it is very difficult to determine the appropriate boundary conditions for $u$ satisfying the Euler-Lagrange equations.