Assuming you have a straight line equation....
Ok if you have a graph you need to select a pair of points that you can clearly identify the x & y points. Call these point 1(x1,y1) and point 2 (x2,y2). It does not matter which point is point 1 or 2.
The slope(gradient) or "m" is given by:
m =(y2-y1) / (x2-x1)
When you worked this "m" value out use this value and either or your points(does't matter which - pick the smaller numbers to make the math easy to do)
Then place the x, y and the m value into this equation to find the unknown "b"
y = mx + b
Then use the "m" and "b" values you have found and place these into
y= mx + b.
---Leave the x and y as letters ----you now have the equation