By graphing the line, it is easy to see that the point (4,10) will partition the line in a ratio of 3:4.
You could also calculate this by finding the difference in x and y coordinates of the given points, and partitioning those differences in a 3:4 ratio on a number line.
In this case,
X coord difference: 12 - (-2) = 14
Y coord difference: 18 - 4 = 14
To partition 14 in a 3:4 ratio, we could use a 6:8 ratio.
One way to think of it, is that you are "adding" 6 and 8 to the x and y coordinates of the lower coordinate, in the case (-2,4).
By "adding" 6 to the x coordinate, and 8 to the y coordinate, we get (4,10), as we showed in the graph.