Theorem.
For a reduced ring $R$ with only finitely many minimal primes show that the following are equivalent.
$(1)$ $\dim (R) = 0.$
$(2)$ $R$ is isomorphic to a direct product of finitely many fields.
Proof.
First of all let us assume that $\dim (R) = 0.$ Let the minimal prime ideals of $R$ be $p_1,p_2, \dots , p_n.$ Since $\dim (R) = 0$ each $p_i$ is maximal for $i=1,2, \dots , n.$ So they are pairwise comaximal. We know that $\bigcap\limits_{i=1}^{n} p_i = \sqrt {0} = (0),$ since $R$ is given to be reduced. So by Chinese Remainder Theorem we can say that $$R \cong \prod\limits_{i=1}^{n} R/p_i.$$
Conversely, if $R \cong \prod\limits_{i=1}^{n} K_i,$ where $K_i$ are fields for $i=1,2, \dots , n$ then for all ideals $I \subseteq R$ the projection of $I$ on $K_i$ is either $(0)$ or $K_i.$ Hence the only elements of $\mathrm{Spec}(R)$ are $$p_i = K_1 \times K_2 \times \cdots \times K_{i-1} \times (0) \times K_{i+1} \times \cdots \times K_n,$$ and each of such $p_i$ are both minimal and maximal.
I have understood the first part of the proof but I find trouble to understand the converse part. How does the projection of ideals of $R$ onto $K_i$'s guarantee that the elements of $\mathrm{Spec}(R)$ are of the above form?
Please help me in this regard. Any help will be highly appreciated.
Thank you very much.
EDIT. I think that I have finally understood it. The prime ideals are of the form $P_1 \times P_2 \times \cdots \times P_n,$ where $P_i = (0)$ or $K_i$ for $i=1,2, \dots,n.$ But there cannot be more than one $P_i$ which are $(0).$ For if there is a prime ideal $P$ whose $i$th and $j$th components are $0$ then we take elements $a=(a_1,a_2,\dots, a_{i-1},0,a_{i+1}, \dots ,a_n)$ and $b=(b_1,b_2, \dots , b_{j-1},0,b_{j+1} , \dots , b_n)$ then $ab \in P$ though $a,b \notin P.$