There is a post about this exact question here I am having the exact same issue and don't find the solution there complete.
Let $Y\subseteq X$ be a subvariety. Let $\mathcal{O}_{Y,X}$ be the set of equivalence classes $\langle U,f\rangle$, where $U\subseteq X$ is open, $U\cap Y\neq \emptyset$, and $f$ is a regular function on $U$. We say that $\langle U,f\rangle$ is equivalent to $\langle V,g\rangle$, if $f=g$ on $U\cap V$. Show that $\mathcal{O}_{Y,X}$ is a local ring, with residue field $K(Y)$ and dimension = $\dim X-\dim Y$.
Let $m=\{\langle U,f\rangle\in \mathcal{O}_{Y,X}|f(P)=0,\ \forall P\in U\cap Y\}$. I have proved that $m$ is the unique maximal ideal of $\mathcal{O}_{Y,X}$. The part that I am stuck on is trying to show that $\mathcal{O}_{Y,X}/m\cong K(Y)$. Many places I've seen just say it's obvious like the solution posted there. I defined a map $\varphi:\mathcal{O}_{Y,X}\rightarrow K(Y)$ by $\langle U,f\rangle\mapsto\langle U\cap Y,f\rangle$. It is clear this map is well defined, and has kernel $m$. The only thing is now I can't show that it is onto. So let $\langle U,f\rangle\in K(Y)$. Since $U$ is open in $Y$ there exists a $V$ such that $U=V\cap Y$. the hope is to extend $f$ to a $g$ such that $g$ is regular on $V$ and $G|_{U}=f$.
I am most interested in a construction of this $g$. With this the problem is complete. Any help would be appreciated. Thanks.