NOTE: the "derivation" make in this answer is not rigorous, it is meant to show a way of looking at the formula in question.
Imagine a hill (in a geographical sense) who's altitude can be described by a function $f(x,y)$. We ignore the curvature of the earth, and consider the hill as standing on a plane in a Euclidean sense. Gravity will therefore by perpendicular to that plane, and we assume that it does not depend on altitude (the gravitational acceleration is constant $g$)
Next, we place some object in some place that has the coordinates $(x_0, y_0)$ and there is no friction between the object and the field. The object will start to slide on the hill in the direction that has the greatest slope. How fast will it change its position in this setup? We can say that given the information so far, the bigger the slope is, the faster the object will change its position.
OK, so far we have that the change in space of the object is proportional with the slope of the field. The slope of the field can be given by what we know as the gradient of the altitude function $\nabla f(x,y)$ so this part is covered. Now what is the rate of change in position, because it can be velocity, acceleration, jerk, etc. Can it be velocity? Not really, because if we consider that the slope of $f$ is constant, then the velocity would be constant and that is not what we see in nature. Can it be acceleration? Let's consider that the slope is $0$. In this case, if the object has some initial velocity, it will have the same velocity at any moment of time after $t_0$ so in some sense, if the slope is $0$, then there is no acceleration. So we could say that the slope is proportional to the acceleration on the object. This means that $(a_x, a_y)=C\nabla f(x,y)$, where $C$ is a constant.
Another thing. Consider a scenario where the slope is positive. If this is the case, the object will accelerate in the same direction with the slope, that is, it will accelerate up-hill. This is not the case in nature, so we add a minus sign and we are all set with the formula $(a_x, a_y)=-C\nabla f(x,y)$, where $C$ is a positive constant this time.
In order to get rid of $C$ we can include it in the slope and we get the differential form $(a_x, a_y)=-\nabla f(x,y)$
And now the last step. If we multiply our formula with the mass of the object, we get on the LHS the force $\vec F(x,y)$, and on the RHS the gradient of some function $U(x,y)$:
$$\vec F(x,y)=-\nabla U(x,y)$$
Now that you have some "intuitive derivation" for the differential form, and since the integral form you used is equivalent (as you mentioned in the comments), I think it should be clearer where the thing comes from.
From my point of view, even if you understand what I said here, you will have to know one of the functions in order to compute the other, and the way to do it is a different story. What you should get from this is how the force is linked to some function that describes the ability of an object to accelerate as a function of space and time.