(a) About Spectrum of a ring $\text{Spec}R$
For any ideal $I$ of $R$, define $V_{I}$ to be the set of prime ideals containing $I$. We can put a topology on $\text{Spec}R$ by defining the collection of closed sets to be $\{V_{I}\colon I{\text{ is an ideal of }}R\}$. This topology is called the Zariski topology
(b) About Zariski topology
In algebraic geometry and commutative algebra, the Zariski topology is a topology which is primarily defined by its closed sets. It is very different from topologies which are commonly used in real or complex analysis; in particular, it is not Hausdorff. An important property of Zariski topologies is that they have a base consisting of simple elements, namely the $D(f)$ for individual polynomials (or for projective varieties, homogeneous polynomials) $f$. That these form a basis follows from the formula for the intersection of two Zariski-closed sets given above (apply it repeatedly to the principal ideals generated by the generators of $(S)$). The open sets in this base are called distinguished or basic open sets. The importance of this property results in particular from its use in the definition of an affine scheme.
(c) About Sheaf
It can be shown that to specify a sheaf, it is enough to specify its restriction to the open sets of a basis for the topology of the underlying space. Moreover, it can also be shown that it is enough to verify the sheaf axioms above relative to the open sets of a covering. This observation is used to construct another example which is crucial in algebraic geometry, namely quasi-coherent sheaves. Here the topological space in question is the spectrum of a commutative ring $R$, whose points are the prime ideals $p$ in $R$. The open sets ${\displaystyle D_{f}:=\{p\subset R,f\notin p\}}$ form a basis for the Zariski topology on this space. Given an $R$-module $M$, there is a sheaf, denoted by $~{\tilde M}$ on the $\text{Spec}R$, that satisfies ${\displaystyle {\tilde {M}}(D_{f}):=M[1/f],}$ the localization of $M$ at $f$.
$\text{Spec}R$ and Zariski topology and sheaf are related concepts. However, $\text{Spec}R$ is a concept composed of open sets, and Zariski topology is a concept centered on closed sets, with zero sets defined as closed sets. I have a question here. The above concepts are composed of open and closed sets, respectively, and I am curious about the background of how $\text{Spec}R$ could be written in the language called sheaf.