How to calculate localizations like the following examples? What techniques are used in general in order to calculate localizations?
1) Let $R = K[X,Y]/(XY)$ and $S = \{ X^n \,|\, n \geq 0 \}$. Then $S^{-1}R \cong K[X,X^{-1}]$.
2) Let $R$ be any ring and $t\in R$. Then $R_t:= \{t^n \,|\, n\geq 0 \}^{-1} R \cong R[Y]/(tY-1)$
3) For an interger $a>1$ and a non-zero integer b let $S$ be the multiplicative subset of $\mathbb{Z}/a\mathbb{Z}$ consisting of the residue classes $b^n + a\mathbb{Z}$ for all $n \geq 0$. Then $$S^{-1}(\mathbb{Z}/a\mathbb{Z}) \cong \prod_{p_i \nmid b} \mathbb{Z}/p_i^{l_i}\mathbb{Z}$$ where $a = \prod p_i^{l_i}$ is the prime factorization of $a$ in $\mathbb{Z}$.