Definition: Let $Z$ be an irreducible closed subset of $X$. Then the codimension $\textrm{codim} (Z,X)$ is the supremum of integers $n$ such that there exists a chain $$ Z = Z_0 < Z_1 < \dots < Z_n$$ of distinct closed irreducible subsets of of $X$.
I want to see that for a ring $A$ and $X = \textrm{Spec } A$, this is equivalent to the definition of heights in commutative algebra, namely,
$$\textrm{ht} (p) = \textrm{codim} (V(p),\textrm{Spec } A )$$ for $p \in \textrm{Spec } A$.
My main issue currently is that I am uncertain of what general irreducible closed subsets of an affine scheme look like.