Decomposition of a matrix in \$ SL_2(\mathbb{Z}) \$
JavaScript (ES6), 68 bytes
This is using xnor's method -- but obviously without complex numbers.
Takes the input matrix \$\begin{pmatrix}a&amp;b\\c&amp;d\end{pmatrix}\$ as 4 distinct parameters a,b,c,d.
Returns a string of digits (\$0\$ for \$S\$, \$1\$ for \$T\$).

f=(a,b,c,d)=&gt;b|c|a-1|d-1?a*c&gt;-b*d?1+f(a-c,b-d,c,d):0+f(c,d,-a,-b):''

Try it online!

JavaScript (ES6),  114 110  108 bytes
Takes the input matrix \$\begin{pmatrix}a&amp;b\\c&amp;d\end{pmatrix}\$ as a 4-element vector [a,b,c,d].
Returns a string of digits (\$0\$ for \$S\$, \$1\$ for \$T\$).
Brute forces a solution, which is guaranteed to be as short as possible, except for the identity matrix.

f=(M,i=0)=&gt;(F=(a,b,c,d,s='')=&gt;s[i]?a+[,b,c,d]==M&amp;&amp;s:F(a,a+b,c,c+d,s+1)||F(b,-a,d,-c,s+0))(1,0,0,1)||f(M,i+1)

Try it online!
Commented
f = (                      // f = wrapper function taking:
  M,                       //   M[] = input vector
  i = 0                    //   i   = maximum number of iterations (-1)
) =&gt; (                     //
  F = (                    // F is a recursive function taking:
    a, b, c, d,            //   the current matrix as 4 distinct parameters
    s = ''                 //   s = output string
  ) =&gt;                     //
    s[i] ?                 // if we've reached the maximum length:
      a + [, b, c, d] == M //   if [a, b, c, d] matches the input matrix:
        &amp;&amp; s               //     return s
    :                      // else:
      F(                   //   try a first recursive call
        a,                 //     where the matrix is multiplied by T
        a + b,             //     [ a b ]   [ 1 1 ]   [ a a+b ]
        c,                 //     [ c d ] x [ 0 1 ] = [ c c+d ]
        c + d,             //
        s + 1              //     append '1' to s
      ) ||                 //
      F(                   //   try a second recursive call
        b,                 //     where the matrix is multiplied by S
        -a,                //     [ a b ]   [ 0 -1 ]   [ b -a ]
        d,                 //     [ c d ] x [ 1  0 ] = [ d -c ]
        -c,                //
        s + 0              //     append '0' to s
      )                    //
)(1, 0, 0, 1)              // initial call to F with the identity matrix
|| f(M, i + 1)             // if it fails, try again with i + 1