This is part of Hartshorne's Exercise I.3.6.
I'm having a bit trouble getting started: I see that $k[x, y]$ embeds in $\mathcal{O}(X)$. Now to show the other direction, I'm very confused by what I should do. I read some other solutions online but they don't make that much sense to me (for example, here, I'm confused by why $h$ not being a unit will fail to make $f \in \mathcal{O}(X)$ and there are lots of details unclear in the proof too).
I'm a beginner to Algebraic Geometry so any help would be very appeciated!