B.
The first thing I do with a line is sub in 0 for x. This will give you the y intercept. On the graph, we can see that the y intercept is (0,5). So, the equation we use has to have an output of 5 if we plug in 0. The only one this applies to is equation B.