Consider a scheme $X$; for every $x\in X$ with residue field $k(x)$, we have the canonical surjection $\mathcal O_{X,x}\longrightarrow k(x)$ that induces the morphism of affine schemes $\operatorname{Spec}(k(x))\longrightarrow\operatorname{Spec}(\mathcal O_{X,x})$. Now if $\operatorname{Spec} A=U\subseteq X$ is an affine open containing $x$, then we have a morphism $$A=\mathcal O_X(U)\longrightarrow \mathcal O_{U,x}=\mathcal O_{X,x} $$
that induces a morphism of schemes $\operatorname{Spec}(\mathcal O_{X,x})\longrightarrow U$.
Reassuming, by composing with the immersion of $U$ in $X$ we obtain a morphism of schemes $\operatorname{Spec}(k(x))\longrightarrow X$. Many texts say that this morphism is independent from the choice of the open affine $U$, but I don't understand why.