We can figure out the factor by just intelligent guessing. we see a [tex]t^2[/tex] on the LHS so RHS should generate it. So the missing factor should contain a [tex]t[/tex]. LHS also has a [tex]3s[/tex]. To get it the factor should contain a [tex]+3[/tex]. Now we can check if other terms of LHS will be generated from the RHS. Our RHS is [tex](t+3)(t+s)=t^2+3s+3t+st=RHS[/tex]. Bingo!!
But more mathematical method will be as follows: [tex] t^2+3s+3t+st\\ =t^2+3t+3s+st\\ =t(t+3)+s(3+t)\\ =t(t+3)+s(t+3)\\ =(t+3)(t+s)\\ [/tex]