From your grade level I am going to assume you are in 6 grade and asking about linear equations, or graphs of lines. Several ways we can do that. Try the following. Look at the graph and find the point where your line intersect with the y axis, we will call this point (0,b). Next, you need to find another point on the line we will label it as (c,d). Now we are trying to find the slope m=(d-b)/(c-0). Finally the equation will be y=mx+b, where b is the y-coord of the y-intercept we found in the first step, and m is the slope.
Depending on your knowledge, the problem can be answered in a slightly different way. You locate two points on the line (x1,y1) and (x2,y2). you find the slope m=(y2-y1)/(x2-x1). After that, you can use either of the points to write the equation, I will use the first. Your equation will be y-y1=m(x-x1). Careful most teachers will expect you to rewrite that in the slope-intercept form, in other words as y=number*x+number.
You need to remember that you can recognize the type of function just analyzing the graph.
Hence, if the graph is a line, then the function is a linear such that: f(x) = ax + b.
If the line intercepts x axis, then the equation of function has one real solution.
If the graph of the function is a parabola, then the function is quadratic: f(x)=ax^2 + bx + c.
If the parabola intercepts x axis two times, then the quadratic equation has two different real roots. If the parabola is tangent to x axis, then the equation has two equal real roots.
If the parabola is concave up, floating above x axis, or it is concave down, under x axis, then the equation has no real roots.
Since the 6 grade math topics covers linear function at most, then there is no need to discuss about other kind of functions, besides linear or quadratic functions.