If you just want some working software, get and read GRBL.
If you want to learn how to make your steppers draw clean lines through space, the best way is to learn about Bresenham's Algorithm and work from there. It's a neat way of drawing a straight line when you have discrete output steps, eg pixels or CNC steps. Think of your line as a 3D function of a parameter, t. Compute the t-values where any of x, y or z changes, and do your changes at those times. Precompute the bit patterns in advance for each step event and send them with a single port write so that you don't get jitter.
For best performance with lines of arbitrary slope, you will want to run a very high-frequency timer and send step events at carefully scheduled times in order to maintain velocity as close to constant as possible. Have a look into the 16-bit timer and how you can use the output-compare functionality to toggle a pin with the timer hardware at a carefully scheduled time.