The basic idea is just to set the two motors opposite to each other (one could be "reversed") at the same speed. One way will go up, the other will go down. Try it out with the joystick first, using one button to make it go up by setting both motors from it, one positive and one negative, and using another button to make it go down.
Once you've got that, if you want to know how far it goes for autonomous stuff, commonly a potentiometer is useful. Measure the angle you've rotated one of the angled pieces from a vertical piece. Once you know this angle, it's some trigonometry and addition to know what height it reaches. You might code things in different ways at that point, such as recording an array of angles that go with different heights of stacks. Even better are two potentiometers to make sure it stays even.
If you only have a specific spot, like a lowest point, you could use a limit switch or similar to tell you when you've reached the bottom.