Informal Definition: The (two-sided) limit of $f(x)$ as $x$ approaches $a$ is equal to $L$ if we can make the value of $f(x)$ as close to $L$ as we like for all $x$ that are close enough (but not equal) to $a$.

In this case we write $\lim_{x\rightarrow a}\ f(x)=L$.

Formal Definition: $\lim_{x\rightarrow a}\ f(x)=L$ if and only if for every $\epsilon >0$ we can find a $\delta >0$ such that
$\ \ \ \ \ \ (*)\ \ \ $ for all $x$, if $x\in (a-\delta,a+\delta)$ and $x\ne a$ then $f(x)\in (L-\epsilon,L+\epsilon)$.

Q: How does the formal definition relate to the informal one?
The "$f(x)$ as close to $L$ as we like" part corresponds to "$f(x)\in (L-\epsilon,L+\epsilon)$", where $\epsilon>0$ is arbitrary (so it can be as small as we like).

The "for all $x$ that are close enough (but not equal) to $a$" part corresponds to "for all $x$, if $x\in (a-\delta,a+\delta)$ and $x\ne a$", where we have to be able to find a $\delta$ that ensures $(*)$ is true.

Note that for smaller values of $\epsilon$ it is harder ensure that $f(x)$ is in the interval $(L-\epsilon,L+\epsilon)$. If we can find a value of $\delta$ such that $(*)$ is true for a given $\epsilon$, then this $\delta$ will make $(*)$ true for all larger values of $\epsilon$, but for a smaller $\epsilon$ we usually need to choose a smaller $\delta$ (if we can even find one).

Q: Why is the $x\ne a$ part included in the definition?
This is quite an important point. The limit, if it exists, should not be affected by the value of $f(a)$ (which may not even be defined). So we do want to consider the case $x=a$, and therefore the formal definition explicitly has to exclude it.

The condition $x \in(a-\delta,a+\delta)$ can be restated as $|x-a|< \delta$, and we can even include the $x\ne a$ part if we say that $0< |x-a|< \delta$.

Similarly the condition $f(x)\in (L-\epsilon,L+\epsilon)$ can be restated as $|f(x)-L|< \epsilon$.

This produces the following alternate form of the formal definition (which is similar to the one in many textbooks):

Alternate Formal Definition: $\lim_{x\rightarrow a}\ f(x)=L$ if and only if for every $\epsilon >0$ we can find a $\delta >0$ such that
for all $x$, if $0< |x -a|< \delta$ then then $|f(x)-L|< \epsilon$.

The last line above is often stated as: "$|f(x)-L|< \epsilon$ whenever $0< |x -a|< \delta$". Here the "for all $x$" part is assumed implicitly, and the "whenever" is the english form of a reverse "if-then". Although shorter, this definition is perhaps not so easy to use when reasoning formally about limits.