you can do these questions by substitution
for the example1
y=3x+1
you need to find a number which is suitable for x and y
when x=1
y=3(1)+1
y=4
so (1,4) is on located on the equation
when x= -1
y=3(-1)+1
y=-2
so(-1,-2) is located on the equation
and now use a ruler to line up (1,4)and(-1,-2)
and that is the equation