The minimum amount of information you need to find the slope of a line is the location of two points on the line. These could be endpoints for a line segment, or just points on a line that goes on forever. Since it's a single, straight line, ANY two different points that are on the line can be used and will give you the exact same slope as any other two points on the same line. Makes sense right? The slope is a property of the line, and all the points on the line make up the line.
The slope formula is easy to remember. The complicated way of saying it is 'the slope is the difference in height of two points on a line, divided by the difference in width of the same two points.' The much easier way is 'slope equals RISE OVER RUN.'
slope = rise / run
The rise (think rising = height) is the difference of the y-coordinates of two points on a line. The run (think about running on the street = horizontal) is the difference of the x-coordinates of the same two points.
Usually, slope is represented by the letter 'm.' So then, the slope equation can be written like:
m = (y2-y1) / (x2 - x1)
This appears to be a little more complex than the first one, but it means the same thing. The 1 and 2 are just names for the y's and x's. (They could be anything... A and B, or whatever.) The (y2-y1) means 'the difference between two y-coordinates, and the (x2-x1) means 'the difference between two x-coordinates.' IMPORTANT: Make sure that the point you use for y2 is the same point you use for x2, and likewise for y1 and x1. (Otherwise, you'll get the wrong slope.)
Another IMPORTANT thing to recognize: if the graph rises to the right, it is said to have a POSITIVE SLOPE. If it is falling towards the right, it has a NEGATIVE SLOPE. That means your slope value will have a positive or negative sign with its number. You can check that when you're done. (It's easy to make sign errors. It happens to everyone.)
This figure should hopefully clear things up.
Let's look at the black line first. Let's call the top point 'point 1' and the bottom point 'point 2'. So:
rise = (y2-y1) = (7-1) = 6
run = (x2-x1) = (7-2) = 5 **Notice that I didn't use (2-7)!
slope = rise/run = 6/5 or 1.2
That's it! Let's look at the red one now. It's a little trickier because of the negative signs, but you do the exact same thing. Point 2 on the left, point 1 on the right:
rise = (y2-y1) = (2-(-5)) = (2+5) = 7
run = (x2-x1) = ((-6)-(-4)) = ((-6)+4) = (-2)
slope = rise/run = 7/(-2) = (-7/2) or (-3.5)
Notice how the first graph had slope of (positive) 1.2 and was going up to the right, and the second one had slope (-3.5) and was falling to the right.
As long as you keep y2 and x2 coming from the same set of coordinates (and y1, x1), and you keep track of your signs, you'll get the right answer for your slope! And with the slope, you can do more complex things, like find an EQUATION that describes the line.