The equation of a line can be written as y=mx+c
m=slope and c = y-intercept
But in the question, It is given as x-intercept is 2
i.e for x=2, y=0
So
using m=-5
we get
y=-5x+c
using for x=2, y=0
we get
0=(-5*2)+c
c=10
So
equation of a line is
y=-5x+10