I'll try breaking it down a different way.
If you find the formula for the line that these points are on, you can then plug any x-coordinate and receive it's y-coordinate.
Here, you're given two points that are on a single line.
The formula for a line is y = mx + b
m is the slope , b is the y-intercept
You're given the slope m already. It's 3. And you have points for y and x.
Now you need to slove for b.
Plug in your first full point (2,-1) => -1 = 2(3)+b
Solving for b = -1 - 2(3) = -7
Now we have our linear formula: y = 3x - 7
Now we can plug the x-coordinate of our next point (5,y) and we will get the y-coordinate
y = 3(5) - 7 = 15 - 7 = 8
y = 8 <= that's your answer