Definition of neighborhood of a point $p$:
Let $X$ be a topological space, then a subset $V$ of $X$ is a neighborhood of $p∈X$ if it contains an open set $U$ containing $p$, in other words: $$x∈U⊆V⊆X$$
I was thinking why we require an open set $U$, and then I came up with the following example:
Let the real line to be our topological space and consider a subset $\color{BLUE}{V=\left[-1,1\right]}$ of the real line, now if we let $U$ to be a closed set then we can find a point like $\color{RED}{1}$ and a subset $U=\left[0,1\right]$ of $\color{BLUE}{V}$ such that $U$ contains $\color{RED}{1}$ , clearly ignoring the condition to be an open set follows that the interval $\color{BLUE}{V=\left[-1,1\right]}$ is actually a neighborhood of the point $\color{RED}{1}$.
But I'm still not sure that my example is right or that's not the reason why we $U$ to be an open set .
If you drop the condition that $U$ is open, then any subset $V$ of $X$ such that $p\in V$ will be a neighborhood of $p$. Just take $U=V$ or $U=\{p\}$.