Let $X$ represent the metric space with distance function $d$. Consider a point $x \in X$ and radius $r$, where $r$ is a real number > 0. An open ball, denoted as $B(x,r)$, is a set of all points $y \in X$ such that the distance between $x$ and $y$ is strictly less than $r$.
$B(x,r) \quad=\quad \{\,y \in X \,\,|\,\, d(x,y) < r\,\}$
The image below depicts an open ball using a dashed line, because it does not include the boundary $r$.
Let $M$ represent the metric space with distance function $d$. A set $X \subseteq M$ is open if for every element $ x \in X $, there exists a $\delta$ > 0 such that $B(x, \delta) \subset X$. $\delta$ is a function of $x$.
A set $C \subset M$ is closed, if the complement $C^c = M-C$ is open.
The image below shows the concept of open and closed sets. For every element $x$ in $X$, there exists an open ball $B(x,\delta)$, such that the ball lies entirely within $X$. Note that X is an open set is depicted by dashed line. $X^c$, the complement of X, which is every element in $M$ that is not in $X$, is a closed set and it includes the boundary of $X$, as shown by the orange line.
$N$ is a neighborhood of $y \in Y$, if $y \in N$ and there exists $\varepsilon > 0$ such that $B(y,\varepsilon) \subseteq N$.
The image below shows the element $y$ in $Y$ and its neighborhood $N$. The open ball $B(y,\varepsilon)$ is contained in $N$.