There are 2 methods used for finding the gradient of a line in 2D space, depending on whether it is a straight line or a curve.
To find the gradient a straight line you must first take the equation of the line, for example and put it into the standard form for an equation of a straight line (y=mx+c) the gradient will be the value of m in this case. If you are not given the equation then you must find 2 points on the line, and find the difference between the 2 "x" values and the 2 "y" values, then divide the difference in "y" values by the difference between the "x" values.
To find the gradient of a curve you must differentiate the equation of the curve.