I was given the example as an illustration of structure of permutations in my lecture notes on algebra as shown below:
$\bigl(\begin{smallmatrix} 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ 2 & 1 & 3 & 4 & 9 & 6 & 5 & 8 & 7 \end{smallmatrix}\bigr)$ $= (12)(597) = (12)(57)(59) = (12)(36)(68)(36)(38)(57)(59)$
I get the first relationship was obtained by cycle decomposition, but how were 2nd and 3rd relationships obtained? If I may use some hints
I doubt that there was any particular general method used. I should think the point is to show that a given permutation can be written as a product of cycles in many ways. To find an example you could take a given permutation $\pi$ and a random choice of cycles $\gamma_1,\ldots,\gamma_s$, write $$\pi=\gamma_1\cdots\gamma_s\sigma\ ,$$ then compute $\sigma$ (and write it as a product of cycles if you like).
The end of your example is possibly useful in that it shows how to write a $3$-cycle as a product of transpositions, $$(597)=(57)(59)\ ,$$ and the bit in the middle can be interpreted siuilarly, $$(36)(68)(36)(38)=(683)(386)=(683)(683)^{-1}=\iota\ .$$ But to sum up again, I think it's just a pretty random example.
BTW a cycle can be written as a product of transpositions in many ways, but IMHO the easiest way to remember is not the one used in your example but $$(a_1a_2a_3\cdots a_n)=(a_1a_2)(a_2a_3)(a_3a_4)\cdots(a_{n-1}a_n)\ .$$