Formula for (small amount of) work done ($dW$) on a body to move it over a (small) distance $\vec{dr}$ using force $\vec{F}$ is given by the dot product
$$dW = \vec{F}\cdot\vec{dr}$$
In electrostatics, the force acting on a charged particle is proportional to its charge $q$ and the electric field $\vec{E}_{(\vec{r})}$ at that point $\vec{r}$ where the charge is situated. So work done by the electric field is
$$dW = q\ \vec{E}_{(\vec{r})}\cdot\vec{dr}$$
If we want to move a charge against the force from the electric field (very slowly), we need to apply an equal and opposite force on the charge (we don't have to apply a force greater than the electric field since we don't intend to accelerate the charged particle. Remember, this is only a thought process used for understanding the formula. More details at Wikipedia). Then, the work done against the electric field is
$$dW = (-1) q\ \vec{E}_{(\vec{r})}\cdot\vec{dr}$$
With suitable assumptions, the work that would have been done on the particle to bring it from an infinite distance away to the location $r_A$ against the force from the electric field is then (by "summing" up the tiny work done over tiny distances from infinity to $r_A$)
$$W = q\ \int_{\infty}^{\vec{r}_A} (-1)\vec{E}_{(\vec{r})}\cdot\vec{dr}$$
Potential is now defined as the work done per unit charge.
From Wikipedia
The electric potential is defined as the amount of work energy needed to move a unit of electric charge from a reference point to the specific point in an electric field. ... By definition, the electric potential at the reference point is zero units. Typically, the reference point is earth or a point at infinity, although any point can be used.
So potential becomes
$$u_A = - \int_{\infty}^{\vec{r}_A} \vec{E}_{(\vec{r})}\cdot\vec{dr}$$