So, for this kind of problem you need to FOIL.
This stands for:
F- first
O-outer
I-inner
L-last
What this means is that:
step 1- multiply the FIRST terms in each thing. So for example in problem 6 of the problems you sent it would be x times x. = [tex] x^{2} [/tex]
step 2- multiply the OUTER terms in each thing. So for example in problem 6, it would be x times 3. =3x
step 3- multiply the INNER terms in each thing. So for example in problem 6, it would be 6 times x. =6x
step 4- multiply the LAST terms in each thing. So for example in problem 6, it would be 6 times 3. =18
step 5: you add all of your products. So for problem 6 it would be y= [tex] x^{2} [/tex] + 9x +18.