In this case they probably just got them out of their head since it's not that difficult to see.
But if you want a methodic approach, just set $$ (-1,2)=\alpha(1,0)+\beta(1,1)\tag{1} $$ with $\alpha,\beta$ to determine. Now $(1)$ is equivalent to $$ -1=\alpha+\beta\\\ 2=\beta $$ Well, you should be able to solve this linear system!
Same thing for $u_2$ obviously.