I want to prove that $\operatorname{Spec}(R_1\times R_2)\cong\operatorname{Spec}(R_1)\sqcup\operatorname{Spec}(R_2).$
I tried proving that every prime ideal in $R_1\times R_2$ is of the form $p\times R_2$ for $p$ prime ideal in $R_1$ or $R_1\times p$ for $p$ prime ideal in $R_2$. Then I tried sending $p\times R_2$ to $p$ and $R_1\times q$ to $q$. But there are few things I don't completely understand.
Why is the union even disjoint? Why can't it be that $R_1=R_2$ for example, or that for some reason $R_1$ and $R_2$ share a prime ideal? What am I missing?
Any help would be appreciated.
You are correct that if $R_1$ and $R_2$ overlap, they can share prime ideals. They can even be the exact same ring, in which case we still comfortably write $\operatorname{Spec}(R \times R) = \operatorname{Spec}(R) \sqcup \operatorname{Spec}(R)$, even though these sets are anything but disjoint.
There are two ways I can answer this. The short answer is that $\sqcup$ is an operation which takes two sets (or spaces (or schemes)) and returns a new set (or...) which contains disjoint copies of the arguments. For instance, $\mathbb R \sqcup \mathbb R$ can be thought of as two disjoint lines in the plane. $\sqcup$ is the disjoint union operation, not a notation for a union which just so happens to be disjoint.
Strictly speaking, we have the equality $\operatorname{Spec}(R_1 \times R_2) = \operatorname{Spec}(R_1) \times \{R_2\} \cup \{R_1\} \times \operatorname{Spec}(R_2)$. Now, the two components of this union are disjoint, so we write this with the disjoint union operation.
The long answer is that worrying about strict equality is the wrong philosophy to have here. Instead, we work with objects up to isomorphism. For instance, we say $\mathbb Z \subseteq \mathbb Q$ right? Wrong! $\mathbb Q$ is a set of equivalence classes of pairs of integers. If we were doing things with strict equality, we'd have to say that there is an isomorphic copy of $\mathbb Z$ within $\mathbb Q$. But this is a tedious detail that's ultimately inconsequential, and frankly obscures the truth. I will write $\mathbb Z \subseteq \mathbb Q$ without any worry about what the literal elements of either of these sets are. We don't privilege any one "copy" of the integers over any other. Instead, we treat these objects non-strictly and really worry only about them up to some notion of isomorphism.
Going back to the spectrum again, the decomposition $\operatorname{Spec}(R_1 \times R_2) = \operatorname{Spec}(R_1) \times \{R_2\} \cup \{R_1\} \times \operatorname{Spec}(R_2)$ is literally disjoint. Furthermore, $\operatorname{Spec}(R_1) \times \{R_2\}$ is isomorphic to $\operatorname{Spec}(R_1)$. Taking the product with the singleton $\{R_2\}$ forms an identical copy of $\operatorname{Spec}(R_1)$. What does it really matter if we label these elements as $\mathfrak p$ or as $\mathfrak p \times \{R_2\}$ or as $\mathfrak p$ but we write its elements upside down? If again, we only consider objects up to isomorphism, then there's no tangible difference between $\operatorname{Spec}(R_1)$ and $\operatorname{Spec}(R_1) \times \{R_2\}$. You will likely learn some category theory if you continue studying algebraic geometry, and a category theorist would think that distinguishing between these two copies of the spectrum is "evil."
To go a bit further, take $\operatorname{Spec}(\mathbb Z \times \mathbb Z) \cong \operatorname{Spec}(\mathbb Z) \sqcup \operatorname{Spec}(\mathbb Z)$. Your concern is that $\operatorname{Spec}(\mathbb Z)$ is not disjoint from itself, but what is $\mathbb Z$ anyways? Equivalence classes of pairs of natural numbers? Rationals of the form $n/1$? Equivalence classes of Cauchy sequences of rationals? Constant polynomials? Constant continuous functions $X \longrightarrow \mathbb C$? Diagonal matrices? Maybe the left and right sides of the product are strictly different interpretations of the integers. But really, who cares? I don't, and I don't want to have to care. Working with objects up to isomorphism, rather than equality, frees you from this tedium. Ultimately, we don't really write math in strict ZFC formalism; we communicate it to other humans. Treating these objects so loosely is not a strictly justified thing, but in principle the details can be recovered, and losing this strict mindset frees us from petty concerns of the literal meaning of the elements of $\mathbb Z$.
I'd also like to warn you that this is mot a blanket pass to replace every instance of $\cong$ with $=$ or vice versa! There is subtlety in what kind of isomorphism the context demands. For instance, two isomorphic normal subgroups $H, K$ of a group $G$ do not generally have isomorphic quotients $G/H, G/K$. Realizing what the appropriate notion of isomorphism is, and how far you can stretch it, is a skill that you can develop over time.