I need to prove the following:
"Prove that the free group of rank 2 is linear."
So to my best understanding, and please correct me if I'm wrong: I actually need to show a homomorphism from the free group to some subgroup of $GLn(\mathbb{F})$ (where $\mathbb{F}$ is a field).
Say $a,b$ are the free group generators, will the following map work? $$a\rightarrow \begin{pmatrix} 1 & s\\ 0 & 1 \end{pmatrix}$$ $$b\rightarrow \begin{pmatrix} 1 & t\\ 0 & 1 \end{pmatrix}$$
where $s,t$ are some elements in $\mathbb{F}$.
Is there a general way to find a linear representation of a group, or is it just trial and error?
No, your map will not work. To see this, consider the powers of the following matrix (I will leave you to join the dots). $$ \left( \begin{array}{cc} 1&1\\0&1 \end{array} \right) $$ Instead, you should consider the following two matrices. $$ \left( \begin{array}{cc} 1&2\\0&1 \end{array} \right)\& \left( \begin{array}{cc} 1&0\\2&1 \end{array} \right) $$ To prove that they form a free group you can use the ping-pong lemma. For a worked, and very readable, proof using (essentially) this method, see John Meier's book Graphs, Groups and Trees, Section 3.1.3. The idea is to consider how these matrices and their inverses act on a coordinate $(a, b)$, and then extend this to regions. Finally, one supposes that a non-empty, reduced word $w$ is trivial and applies this to a region $X$, but it is seen that this yields a different region, $wX\neq X$, so $w$ cannot be trivial.
Interestingly, free groups are rather prevalent in linear groups. This is because of the following result of Tits.
Theorem (Tits, 1972): Suppose $G$ is linear. If $G$ does not contain a free group then $G$ is virtually soluble.
A group is virtually soluble (solvable) if it contains a finite index subgroup which is soluble. It is a relatively straight forward exercise to prove that virtually soluble groups do not contain free groups, and so Tits' result can be interpreted as saying "linear groups contain free groups unless that obviously do not".